Menu icon Foundation
Open PDF on Mobile?

This is more of a HTML question in general as opposed to Foundation 6 but I am wondering if Foundation has a solution to this.

I am creating a local site (offline) that has several PDF documents to open. I have links set up like this:

<ul>
  <li><a href="doc.pdf><img src="icon.png">Document Description</a></li>
</ul>

The links open the PDFs perfectly in desktop but do not open at all on mobile. How could I have the same functionality on mobile? I am considering pdf.js to solve this.

Thank you!!

pdf

This is more of a HTML question in general as opposed to Foundation 6 but I am wondering if Foundation has a solution to this.

I am creating a local site (offline) that has several PDF documents to open. I have links set up like this:

<ul>
  <li><a href="doc.pdf><img src="icon.png">Document Description</a></li>
</ul>

The links open the PDFs perfectly in desktop but do not open at all on mobile. How could I have the same functionality on mobile? I am considering pdf.js to solve this.

Thank you!!

Jarryd Fillmore over 2 years ago

Strange -- this should open regardless if you're on mobile, tablet or desktop.

RCD over 2 years ago

Actually it works in Chrome (which android wont open html with by default, but that is another story)... but Firefox says "unable to download file".  The files are in local folders so there is nothing to download, unless that is its way of access docs. There must be a cross browser solution...

Jeremy Rhoads 5 months ago

Agree with the replies were given above here, there's close to null chance that it would not open on mobiles only because of issues with the code. How many phones have you used in order to test this, and on what OS exactly? Or maybe there are some problems with scaling of pdf-file, then you need to do some edits and conversions. For the first one simple Adobe Acrobat would fit fine, for the second purpose I suggest choosing something here https://www.altopdf.com/ I do think that feature would run smoothly afterwards