Wish PDF Viewer with zoom and scroll

johan vetsuypens

Member
Licensed User
In B4A you could use the below intent to view a PDF file. Would be nice to have the same functionality in B4i

Dim i As Intent 'Requires a reference to the Phone library
i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal , "data.pdf"))
i.SetType("application/pdf")
i.WrapAsIntentChooser("Choose PDF Viewer")
StartActivity(i)
Activity.Finish

Thanks,
Johan
 

shashkiranr

Active Member
Licensed User
Have you tried to just load the pdf to the WebView? I expect it to work:
B4X:
WebView1.LoadUrl("file://" & File.Combine(File.DirAssets, "yourpdf.pdf"))
Hi Erel,

When i try the above code, only a white screen appears.

Regards,
SK
 

mtechteam

Member
Licensed User
Erel,

We have the same issue. Our quirk is that it works great in debug but not in release. This is b4i, whether 1.x or 2.0. Any thoughts? Here is a file with the pertinent code.

Tm
 

Attachments

Top