iOS Question how to open website pdf file in Page2

Baris Karadeniz

Active Member
Licensed User
I use Page1 for webview in my project. There are some pdf files at the web site. They are opened on Page1 too. I want that pdf files are opened at Page2. How can I provide pdf files open at Page2?
 

Baris Karadeniz

Active Member
Licensed User
Here are the codes. What should I write at the dotted line? Or some other ways?

Sub WebView1_OverrideUrl (Url As String) As Boolean
If Url.EndsWith(".pdf") Then
NavControl.ShowPage(Page2)
.......................................................
Return True
Else
Return False
End If
End Sub
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Please use [code]code here...[/code] tags when posting code.
2. It is difficult to help if you make duplicate posts.

A simple way to show the pdf on the second page is to add a WebView to the second page and load the pdf url to that WebView:
B4X:
Sub WebView1_OverrideUrl (Url As String) As Boolean
If Url.EndsWith(".pdf") Then
NavControl.ShowPage(Page2)
WebViewThatBelongsToPage2.LoadUrl(Url)
Return True
Else
Return False
End If
End Sub
 
Upvote 0
Top