Page 3 of 3
Re: New approach for offline viewing PDF inside Android brow
Posted: Thu Sep 21, 2017 11:58 am
by MaxV
jim1001 wrote:
On mobile all the files selected to include in your app, from the Standalone application settings, are copied in specialFolderPath("Engine").
Well my case is special in that I will be personally installing my app on the few devices that will be using it. The app I’m developing has a lot of media files, eg videos, PDFs, that I don’t want to copy over each time I build & install the app. I will be able to copy these media files to the devices outside LiveCode and reference them by absolute path name from LiveCode.
Anyhow I would still like to understand your suggestion.
copy all files and folder in specialFolderPath("Documents"),
Can you explain this please? What files and folders do you mean? Where, when and how do you do this?
The folder specialFolderPath("engine") on Android is
read only. So it's a problem.
the folder specialFolderPath("Documents") it's read and write. No problem with files here.
jim1001 wrote:
overwrite the test.pdf with your file,
Do you mean ... ?
I mean just copy the PDF file to test.pdf :
Code: Select all
put URL ("binfile:path/to/myfile.pdf") into URL ("binfile:" & specialFolderPath("Documents") & "/PDFViewer/pdfjs/web/test.pdf")
then reload the page in the browser to update the reader.
Re: New approach for offline viewing PDF inside Android browser
Posted: Tue Oct 17, 2017 4:09 pm
by jim1001
MaxV ,
Thanks for your latest post which I’ve only just come to look at again.
I wonder if you are able to get this working without copying over files with the app, i.e. by putting the folder pdfjs & its subfolders on your target Android device before installing your app and then referring to them using absolute paths?
Re: New approach for offline viewing PDF inside Android browser
Posted: Tue Oct 17, 2017 4:34 pm
by jim1001
I wonder if you are able to get this working without copying over files with the app, i.e. by putting the folder pdfjs & its subfolders on your target Android device before installing your app and then referring to them using absolute paths?
I just got this working! Now I'll try copying in a different PDF using the app...
Re: New approach for offline viewing PDF inside Android browser
Posted: Tue Oct 17, 2017 5:26 pm
by jim1001
Now able to let the user change the PDF displayed in the app by using MaxV's suggestion of copying over the DEFAULT_URL file specified in viewer.js.
The first problem I had was specifying the URLs incorrectly. Then when the PDF controls showed without a PDF file (just an empty window) I changed the Minimum Android Version back to 2.3.3 after reading an earlier post by rmuzzini. I needed both these things to be right before everything worked.
Many thanks MaxV & rmuzzini!
Re: New approach for offline viewing PDF inside Android browser
Posted: Sat Nov 24, 2018 1:22 pm
by Youks
Hi Gents,
Could anyone indicate how to use it for online PDF ? I followed all the steps but this doesn't seem to be working for me for PDF not in the phone. Any method?
Thx
Re: New approach for offline viewing PDF inside Android browser
Posted: Sun Nov 25, 2018 11:10 am
by Youks
Hi All,
As minimum built is 4.1 now (2.3.3) not available, therefore this method is still showing blank PDF unfortunately. Any workaround available ?
Thx
Re: New approach for offline viewing PDF inside Android browser
Posted: Sun Nov 25, 2018 10:23 pm
by capellan
Hi Youks,
After downloading MaxV zipped folder, I was able to load an online PDF
after replacing the original button script with this handler:
Code: Select all
on mouseUp
set the url of widget 1 to "https://www.ic.unicamp.br/~pannain/mc404/aulas/pdfs/Art%20Of%20Intel%20x86%20Assembly.pdf"
end mouseUp
Notice that MaxV original script allows you to choose a PDF to display
inside LiveCode Browser, so if you want that users select an online PDF
you could use a locked text field for this.
Al
Re: New approach for offline viewing PDF inside Android browser
Posted: Mon Nov 26, 2018 12:44 am
by FourthWorld
Why does the PDF need to be displayed specifically within a browser object? In most apps that support opening PDFs they launch the build-in PDF viewer in a separate process.
What's in these PDFs?
Re: New approach for offline viewing PDF inside Android browser
Posted: Mon Nov 26, 2018 5:38 am
by Youks
Hi Capellan,
I am on LC9.0.1 MAC version, on android your given script doesn't work (blank page) using Max's example. I was hoping to make this work with the PDF.js viewer as well but no joy.
For the purpose of my app i am looking into an embedded browser solution, I am accessing PDF of daily weather charts. As an alternative these charts are available in GIF format but then i lose the functionality of the browser in terms of gesture and zooming.
Thanks
Re: New approach for offline viewing PDF inside Android browser
Posted: Mon Dec 30, 2019 2:40 pm
by Klaus
Hi all,
now that LC 9.6.x will finally support "Print to PDF" on Android, what is
the current state of displying LOCAL PDF files on Androind inside of LC?
Thanks for any insight!
Best
Klaus
Re: New approach for offline viewing PDF inside Android browser
Posted: Sun Jan 05, 2020 5:03 pm
by Klaus
Klaus wrote: Mon Dec 30, 2019 2:40 pm
Hi all,
now that LC 9.6.x will finally support "Print to PDF" on Android, what is
the current state of displying LOCAL PDF files on Androind inside of LC?
Thanks for any insight!
NOONE?

Re: New approach for offline viewing PDF inside Android browser
Posted: Sun Jan 05, 2020 5:38 pm
by bogs
Much as I would love to tell you the answer, I just don't happen to know
Sorry 
Re: New approach for offline viewing PDF inside Android browser
Posted: Sun Jan 05, 2020 5:49 pm
by Klaus
I really did not intend to sue you for not knowing this, mon ami!

Re: New approach for offline viewing PDF inside Android browser
Posted: Sun Jan 05, 2020 6:01 pm
by bogs