Display PDFs on Mobile device
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Display PDFs on Mobile device
Hello LiveCoders!
I have been trying to seek the answer for this question for a few weeks but have not been able to find a perfect solution. I am trying to create a standalone mobile app that can display multiple PDFs. I have reviewed the LiveCode Lessons and they seem to work fine for desktop and maybe they work for mobile but I'm not making the connection.
For example, using: launch document "Getting Started with Revolution.pdf"
allows me to select a PDF that has been saved to my desktop but where do I save a PDF in my app to make it standalone? Also, I've tried the web browser option but I need a PDF viewer that can operate without internet access.
Does anyone know if this is possible? I just want to look at a couple PDFs without internet access on my phone.
I have been trying to seek the answer for this question for a few weeks but have not been able to find a perfect solution. I am trying to create a standalone mobile app that can display multiple PDFs. I have reviewed the LiveCode Lessons and they seem to work fine for desktop and maybe they work for mobile but I'm not making the connection.
For example, using: launch document "Getting Started with Revolution.pdf"
allows me to select a PDF that has been saved to my desktop but where do I save a PDF in my app to make it standalone? Also, I've tried the web browser option but I need a PDF viewer that can operate without internet access.
Does anyone know if this is possible? I just want to look at a couple PDFs without internet access on my phone.
Re: Display PDFs on Mobile device
Hi Bromo,
the search function isn't really THAT bad, that one should not use it
OK, what platform?
On iOS you can display a PDF file in a native browser object,
but there are no build-in capabilities on Android.
Best
Klaus
the search function isn't really THAT bad, that one should not use it
OK, what platform?
On iOS you can display a PDF file in a native browser object,
but there are no build-in capabilities on Android.
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Display PDFs on Mobile device
Are you asking how to create PDFs from your stack content? Or something else?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Display PDFs on Mobile device
Guessing the op really wants to know how to save a PDF along with all the assets of the standalone, and how to retrieve it for display via the standalone on mobile.
I'd give a more detailed answer assuming that's right, but it's painful on this phone
I'd give a more detailed answer assuming that's right, but it's painful on this phone
-
- Posts: 192
- Joined: Tue Mar 11, 2014 12:57 pm
Re: Display PDFs on Mobile device
You could save a pdf on Google Drive and then use launch url to open it.
Or:
See http://livecode.com/livecode-7/embedded-web/
Or:
See http://livecode.com/livecode-7/embedded-web/
Re: Display PDFs on Mobile device
This is exactly what I'm trying to do. Assume there is no internet connection because you are lost deep in the mountains and therefore cannot access the web. I'd like to be able to pull out my phone and open up a couple of PDFs.SparkOut wrote:Guessing the op really wants to know how to save a PDF along with all the assets of the standalone, and how to retrieve it for display via the standalone on mobile.
I'd give a more detailed answer assuming that's right, but it's painful on this phone
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Display PDFs on Mobile device
Sorry, I'm still confused. Where is the original content coming from? A downloaded PDF? A printout of the card or a field?
If you mean you want to save stack content, that's done with the "open printing" command using the pdf option.
If you mean you want to save stack content, that's done with the "open printing" command using the pdf option.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Display PDFs on Mobile device
He wants to bundle a PDF document with the standalone to be able to display it on mobile without being connected to internet services
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Display PDFs on Mobile device
Oh! Thanks for the translation SparkOut. Sorry to be so obtuse.SparkOut wrote:He wants to bundle a PDF document with the standalone to be able to display it on mobile without being connected to internet services
Bromo: There is no file picker on mobile but you can get "the files" to see a list of available files in a folder and then put that list into a field in your stack. That will allow you to select one of them to launch.
To include the pdfs in your app, I'd put them all into a folder and then add the whole folder to the Copy File pane in the Standalone Settings. When you build the standalone the folder will be included next to the engine. (There's a minor bug with file paths on iOS but it's being fixed. If that's an issue for you, let us know. There's a workaround.)
So now you have the pdf files in a folder that travels with your app and you need a script to get a selected file and launch it. The idea is:
set the defaultFolder to the one containing the pdf files
get the files
display them in a field
And to launch one of them:
get the text of the line the user clicks
launch that file
If you need help scripting that, let us know.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Display PDFs on Mobile device
Jacque,
Thank you for your explanation. I am going to try this it sounds like it could work. You have given me a critical bit of information that I have been searching for. Is it possible for me to script a button so it automatically chooses a file within the folder or will the user always need to select the file?
Thank you for your explanation. I am going to try this it sounds like it could work. You have given me a critical bit of information that I have been searching for. Is it possible for me to script a button so it automatically chooses a file within the folder or will the user always need to select the file?
Re: Display PDFs on Mobile device
Hi Bromo,
Yes sure, presumed you added your PDF file(s) via the "Copy files" TAB in the standalone builder settings as separate files,
you can find them in the final APP here -> specialfolderpath("engine")
...
put specialfolderpath("engine") & "/Name of your PDF here.pdf" into tFile
## Now do something with tFile
...
Best
Klaus
we hope so!Bromo wrote:Is it possible for me to script a button so it automatically chooses a file within the folder...?
Yes sure, presumed you added your PDF file(s) via the "Copy files" TAB in the standalone builder settings as separate files,
you can find them in the final APP here -> specialfolderpath("engine")
...
put specialfolderpath("engine") & "/Name of your PDF here.pdf" into tFile
## Now do something with tFile
...
Best
Klaus