Page 1 of 1

How do I open a pdf file via a link on a website?

Posted: Tue May 04, 2021 1:06 pm
by Peter@multidesk.se
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

Re: How do I open a pdf file via a link on a website?

Posted: Tue May 04, 2021 1:50 pm
by jmburnod
Hi Peter,
This sound like a missing inclusion
Jean-Marc

Re: How do I open a pdf file via a link on a website?

Posted: Tue May 04, 2021 1:51 pm
by Klaus
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

Re: How do I open a pdf file via a link on a website?

Posted: Tue May 04, 2021 3:08 pm
by Peter@multidesk.se
It works in the android phone's default browser. if there is a missing inclusion, which one? :?

///Peter

Re: How do I open a pdf file via a link on a website?

Posted: Tue May 04, 2021 4:29 pm
by Klaus
Hi Peter,

no missing inclusion or whatever, it just does not work in the LC browser on Android.


Best

Klaus

Re: How do I open a pdf file via a link on a website?

Posted: Tue May 04, 2021 8:54 pm
by FourthWorld
Another good question might be why one would want to attempt to read a PDF on a small screen.

Re: How do I open a pdf file via a link on a website?

Posted: Tue May 04, 2021 10:16 pm
by bogs
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) ?

Re: How do I open a pdf file via a link on a website?

Posted: Tue May 04, 2021 11:20 pm
by FourthWorld
bogs wrote:
Tue May 04, 2021 10:16 pm
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) ?
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.

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.

Re: How do I open a pdf file via a link on a website?

Posted: Wed May 05, 2021 9:07 am
by AxWald
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:
  • 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.
My Android apps suggest the installation of "MuPDF viewer" at 1st startUp & in 'Help' (with an external play store link) *1), so that "launch URL *.pdf" works later.

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.

Re: How do I open a pdf file via a link on a website?

Posted: Sat May 08, 2021 3:18 pm
by andresdt
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").