Nov 27, 2013 Replies: 24 jFX.ShowExternalDocument method allows you to open external documents with the default installed app. It expects a single parameter which is the document or resource Uri (link). You can use File.GetUri to get the Uri of a local file. For example to open a local PDF document: Code: Copy fx.ShowExternalDocument(File.GetUri("C:\Users\H\Documents", "Document.pdf")) You can also use it with a non-local resource: Code: Copy fx.ShowExternalDocument("http://www.b4x.com") Caveats: - This method doesn't throw any error if the resource cannot be opened. - You cannot use this method with assets files (files added to the Files tab). It will only fail in Release mode when the files are packaged inside the jar. You can use File.Copy to copy it from the assets folder and then open it. This method was added in V1.00 beta 6. Click to expand...
jFX.ShowExternalDocument method allows you to open external documents with the default installed app. It expects a single parameter which is the document or resource Uri (link). You can use File.GetUri to get the Uri of a local file. For example to open a local PDF document: Code: Copy fx.ShowExternalDocument(File.GetUri("C:\Users\H\Documents", "Document.pdf")) You can also use it with a non-local resource: Code: Copy fx.ShowExternalDocument("http://www.b4x.com") Caveats: - This method doesn't throw any error if the resource cannot be opened. - You cannot use this method with assets files (files added to the Files tab). It will only fail in Release mode when the files are packaged inside the jar. You can use File.Copy to copy it from the assets folder and then open it. This method was added in V1.00 beta 6.
Erel B4X founder Staff member Licensed User Longtime User Apr 13, 2015 #21 It does work here (I've tested it with the http url on a Mac). If it doesn't work then your other option is to find the correct app and start it with jShell.
It does work here (I've tested it with the http url on a Mac). If it doesn't work then your other option is to find the correct app and start it with jShell.
S syerif Active Member Licensed User Longtime User Mar 23, 2019 #22 Can we get feedback from this method? url?
DonManfred Expert Licensed User Longtime User Mar 23, 2019 #23 syerif said: Can we get feedback from this method? url? Click to expand... What do you mean with feedback? If you want to open url you give already.... Erel said: fx.ShowExternalDocument("http://www.b4x.com") Click to expand... in this case you are opening the url http://www.b4x.com Just remember the url used. Or what do you mean?
syerif said: Can we get feedback from this method? url? Click to expand... What do you mean with feedback? If you want to open url you give already.... Erel said: fx.ShowExternalDocument("http://www.b4x.com") Click to expand... in this case you are opening the url http://www.b4x.com Just remember the url used. Or what do you mean?
S syerif Active Member Licensed User Longtime User Mar 23, 2019 #24 DonManfred said: What do you mean with feedback? If you want to open url you give already.... in this case you are opening the url http://www.b4x.com Just remember the url used. Or what do you mean? Click to expand... i mean if the page is redirect to another page...
DonManfred said: What do you mean with feedback? If you want to open url you give already.... in this case you are opening the url http://www.b4x.com Just remember the url used. Or what do you mean? Click to expand... i mean if the page is redirect to another page...
DonManfred Expert Licensed User Longtime User Mar 23, 2019 #25 syerif said: i mean if the page is redirect to another page... Click to expand... no, you dont get any callback as the command is calling a windows method which, in case of a url, usually just open the browser to show the url.
syerif said: i mean if the page is redirect to another page... Click to expand... no, you dont get any callback as the command is calling a windows method which, in case of a url, usually just open the browser to show the url.