red30 Well-Known Member Licensed User Longtime User Aug 18, 2020 #1 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?
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?
DonManfred Expert Licensed User Longtime User Aug 18, 2020 #2 Copy the file to DirData first and open it from there. Upvote 0
red30 Well-Known Member Licensed User Longtime User Aug 18, 2020 #3 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? DonManfred said: Copy the file to DirData first and open it from there. Click to expand... I don't understand how DirData works ... Can I have an example? Last edited: Aug 18, 2020 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? DonManfred said: Copy the file to DirData first and open it from there. Click to expand... I don't understand how DirData works ... Can I have an example?
Erel B4X founder Staff member Licensed User Longtime User Aug 19, 2020 #4 See the first search result: https://www.b4x.com/android/forum/pages/results/?query=dirdata Upvote 0
red30 Well-Known Member Licensed User Longtime User Aug 19, 2020 #5 Erel said: See the first search result: https://www.b4x.com/android/forum/pages/results/?query=dirdata Click to expand... I don't understand how this helps me? Where can I put the pdf file so that it becomes part of the application? So that after installing the exe, when you click this button, the file will open. Upvote 0
Erel said: See the first search result: https://www.b4x.com/android/forum/pages/results/?query=dirdata Click to expand... I don't understand how this helps me? Where can I put the pdf file so that it becomes part of the application? So that after installing the exe, when you click this button, the file will open.
red30 Well-Known Member Licensed User Longtime User Aug 19, 2020 #6 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
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 ...
Erel B4X founder Staff member Licensed User Longtime User Aug 19, 2020 #7 Put it in the Files folder and copy it to File.DirData at runtime. Upvote 0