How to embed a PDF viewer in a page?

Andrei Oniga picture Andrei Oniga · Dec 29, 2012 · Viewed 334.8k times · Source

If I'm not mistaken, Google Docs offers the means to display a PDF that is stored on the same server as the web page via an <iframe>, but I need to know how I can do this in a cross-browser compliant way.

Answer

Ian Gregory picture Ian Gregory · Dec 29, 2012

You could consider using PDFObject by Philip Hutchison.

Alternatively, if you're looking for a non-Javascript solution, you could use markup like this:

<object data="myfile.pdf" type="application/pdf" width="100%" height="100%">
  <p>Alternative text - include a link <a href="myfile.pdf">to the PDF!</a></p>
</object>