How do I open a pdf file via a link on a website?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
How do I open a pdf file via a link on a website?
I have tried with both Widget browser and mobileControlCreate but when I click on a link on the page, nothing happens. However, it works in my IDE...
Anyone know why?
///Peter
Anyone know why?
///Peter
/*Whats all the fuss with c# ?*/
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: How do I open a pdf file via a link on a website?
Hi Peter,
This sound like a missing inclusion
Jean-Marc
This sound like a missing inclusion
Jean-Marc
https://alternatic.ch
Re: How do I open a pdf file via a link on a website?
Hi Peter,
if I remember correctly, we cannot display a PDF file in a browser on Android, because Android does not support this.
Best
Klaus
if I remember correctly, we cannot display a PDF file in a browser on Android, because Android does not support this.
Best
Klaus
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Re: How do I open a pdf file via a link on a website?
It works in the android phone's default browser. if there is a missing inclusion, which one?
///Peter
///Peter
/*Whats all the fuss with c# ?*/
Re: How do I open a pdf file via a link on a website?
Hi Peter,
no missing inclusion or whatever, it just does not work in the LC browser on Android.
Best
Klaus
no missing inclusion or whatever, it just does not work in the LC browser on Android.
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: How do I open a pdf file via a link on a website?
Another good question might be why one would want to attempt to read a PDF on a small screen.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: How do I open a pdf file via a link on a website?
This isn't meant to be sarcastic or me having a problem with what your saying Richard, but I've seen some pretty dang big android screens, almost big enough to tempt me to buy a mobile device (if I had any use for it).
Aside from that, how would reading a pdf file on (device x of your choice) be any different than reading a web page on (device x of your choice) ?
Aside from that, how would reading a pdf file on (device x of your choice) be any different than reading a web page on (device x of your choice) ?
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: How do I open a pdf file via a link on a website?
Most PDFs are formatted for printing on standard size paper (in US, 8.5x11"). On a full-sized tablet (3% of usage), designed as they are to match a page, in portrait mode PDFs work great. On a desktop (45% of usage) the full width is available, so only vertical scrolling is occasionally needed. But on a phone (52% of usage) it means tediously scrolling around the document both horizontally and vertically while reading each line.bogs wrote: ↑Tue May 04, 2021 10:16 pmThis isn't meant to be sarcastic or me having a problem with what your saying Richard, but I've seen some pretty dang big android screens, almost big enough to tempt me to buy a mobile device (if I had any use for it).
Aside from that, how would reading a pdf file on (device x of your choice) be any different than reading a web page on (device x of your choice) ?
If the destination for the document is a printer, PDF is an excellent choice. For all other use cases I use different formats, depending on what's needed.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: How do I open a pdf file via a link on a website?
Hi,
Very often the use of PDFs is questionable, IMHO - the PDF format was meant as a read-only, digital version of a printed page. There's quite some use cases where it actually makes sense - the digital transmission of documents (in a legal sense), for instance.
Most often, though, a PDF isn't more than the misguided effort of a "web-designer" to display data in a fancy way without the added expense to "html/CSS" it, or the result of a moronic default setting of a cheap consumer scanner.
In any case, the existence of PDF is a reality.
There's (desktop) browsers that display PDFs, but that's often not quite the best choice. On Android it's expected to have a dedicated PDF viewer for this, IMHO a good choice.
Some readers I can recommend:
With a suitable viewer available I cannot see any special problems regarding PDFs, even on small screens. For the user it's the same as navigating most web sites - drag, pinch, swipe. They are well used to this.
For sure, some of us older ones (myself included) will start to pull our few remaining hairs, yelling for the magnifier. Presbyopia is a reality, as is the existence of PDFs. And we better get used to this ;-)
Have fun!
*1): The desktop version comes bundled with "SumatraPDF" that uses the MuPDF engine, too. And my program uses it explicitly, even if other PDF viewers are installed.
Very often the use of PDFs is questionable, IMHO - the PDF format was meant as a read-only, digital version of a printed page. There's quite some use cases where it actually makes sense - the digital transmission of documents (in a legal sense), for instance.
Most often, though, a PDF isn't more than the misguided effort of a "web-designer" to display data in a fancy way without the added expense to "html/CSS" it, or the result of a moronic default setting of a cheap consumer scanner.
In any case, the existence of PDF is a reality.
There's (desktop) browsers that display PDFs, but that's often not quite the best choice. On Android it's expected to have a dedicated PDF viewer for this, IMHO a good choice.
Some readers I can recommend:
- FBReader with PDF plugin - A reader for e-book/ text/ comic docs. Enormously configurable, has lots of features and supports a wide range of formats. Free & full version. For those that expect to read a lot.
- MuPDF - AGPL, small, fast, 3 flavors (full, viewer, mini). For the occaisonal display of PDFs. Or as a second, faster alternative to FBReader.
- for sure there's a ton more, some of it may be good.
With a suitable viewer available I cannot see any special problems regarding PDFs, even on small screens. For the user it's the same as navigating most web sites - drag, pinch, swipe. They are well used to this.
For sure, some of us older ones (myself included) will start to pull our few remaining hairs, yelling for the magnifier. Presbyopia is a reality, as is the existence of PDFs. And we better get used to this ;-)
Have fun!
*1): The desktop version comes bundled with "SumatraPDF" that uses the MuPDF engine, too. And my program uses it explicitly, even if other PDF viewers are installed.
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
Re: How do I open a pdf file via a link on a website?
Hello, I have faced that problem. In my case, I was not very clear about the structure of the Android apps, the permissions and virtual folders ...
Look up the specialFolderPath function in the dictionary and read the description for its use on Android. That helped me a lot.
Broadly speaking, what happens is that the IDE and the other applications have read permission on the PDF file on the PC. While in Android the thing is very different, since to show the PDF another application is required. What you need to do is copy your PDF to a folder where it can be read by other apps.
Look at the example that I share with you. Use LC 9.6.2 (rc.1) But this should work for all versions.
Just copy the PDF to a folder where other apps have permission. In the example I copy it to specialFolderPath ("documents").
Look up the specialFolderPath function in the dictionary and read the description for its use on Android. That helped me a lot.
Broadly speaking, what happens is that the IDE and the other applications have read permission on the PDF file on the PC. While in Android the thing is very different, since to show the PDF another application is required. What you need to do is copy your PDF to a folder where it can be read by other apps.
Look at the example that I share with you. Use LC 9.6.2 (rc.1) But this should work for all versions.
Just copy the PDF to a folder where other apps have permission. In the example I copy it to specialFolderPath ("documents").
- Attachments
-
- OpenPDF_Android.zip
- (60.8 KiB) Downloaded 119 times