marcick Well-Known Member Licensed User Longtime User Oct 23, 2017 #1 I don't know why I'm able to run this code only in debug mode. When I compile in release, I see the list of Apps, I choose "Open with Ibooks" as usual and the screen returns to the main page, not showing the pdf. I have Iphone Library 2.00 and the pdf is in the files folder of course Code: Sub Process_Globals 'These global variables will be declared once when the application starts. 'Public variables can be accessed from all modules. Public App As Application Public NavControl As NavigationController Private Page1 As Page Private di As DocumentInteraction End Sub Private Sub Application_Start (Nav As NavigationController) NavControl = Nav Page1.Initialize("Page1") Page1.Title = "Page 1" Page1.RootPanel.Color = Colors.White NavControl.ShowPage(Page1) di.Initialize("di", File.DirAssets, "manuale bmap4i.pdf") '<--- open a file from the assets folder End Sub Sub Page1_Click di.OpenFile(Page1.RootPanel) End Sub Sub di_Closed Log("Dialog closed") End Sub Sub di_SendingFile Log("Opening file") End Sub
I don't know why I'm able to run this code only in debug mode. When I compile in release, I see the list of Apps, I choose "Open with Ibooks" as usual and the screen returns to the main page, not showing the pdf. I have Iphone Library 2.00 and the pdf is in the files folder of course Code: Sub Process_Globals 'These global variables will be declared once when the application starts. 'Public variables can be accessed from all modules. Public App As Application Public NavControl As NavigationController Private Page1 As Page Private di As DocumentInteraction End Sub Private Sub Application_Start (Nav As NavigationController) NavControl = Nav Page1.Initialize("Page1") Page1.Title = "Page 1" Page1.RootPanel.Color = Colors.White NavControl.ShowPage(Page1) di.Initialize("di", File.DirAssets, "manuale bmap4i.pdf") '<--- open a file from the assets folder End Sub Sub Page1_Click di.OpenFile(Page1.RootPanel) End Sub Sub di_Closed Log("Dialog closed") End Sub Sub di_SendingFile Log("Opening file") End Sub
Erel B4X founder Staff member Licensed User Longtime User Oct 23, 2017 #2 Does it work if you copy the file to File.DirDocuments? File.DirAssets is located in a different place in debug mode. Upvote 0
Does it work if you copy the file to File.DirDocuments? File.DirAssets is located in a different place in debug mode.
marcick Well-Known Member Licensed User Longtime User Oct 23, 2017 #3 No, it doesn't. I have an Iphone7S plus with IOS11 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 23, 2017 #4 This code works: Code: File.Copy(File.DirAssets, "Document1.pdf", File.DirTemp, "Document1.pdf") di.Initialize("di", File.DirTemp, "Document1.pdf") Upvote 0
This code works: Code: File.Copy(File.DirAssets, "Document1.pdf", File.DirTemp, "Document1.pdf") di.Initialize("di", File.DirTemp, "Document1.pdf")
marcick Well-Known Member Licensed User Longtime User Oct 23, 2017 #5 Sorry Erel I didn't catch exactely your hint before. Yes, now it works, thank you very much. Upvote 0