B4J Question Open external PDF document

red30

Well-Known Member
Licensed User
Longtime User
There is adc.pdf file in the Files folder of my project. I want this file to open when the button is clicked.
B4X:
Sub btnInfo_Click   
    fx.ShowExternalDocument(File.GetUri(File.DirAssets, "adc.pdf"))
End Sub
When you press the button, nothing happens. Why? How can I open an external pdf file?
 
Copy the file to DirData first and open it from there.
 
Upvote 0
If I place the pdf file in the Objects folder, then I can open it with:
B4X:
Sub btnInfo_Click  
    fx.ShowExternalDocument(File.GetUri(File.DirApp, "adc.pdf"))
End Sub
If I pack such a project into an "exe" using B4JPackager, then after installing the "exe" the pdf file no longer opens. Why does this happen?
Copy the file to DirData first and open it from there.
I don't understand how DirData works ... Can I have an example?
 
Last edited:
Upvote 0
Maybe I misinterpreted something. I have a pdf file. I am creating an exe file with B4JPackager. I want this exe to contain a pdf file. So that when installing the application, I always have access to this file. I don't understand how to do this ...
 
Upvote 0
Back
Top