PDFObject has been updated to version 1.2, and now supports Internet Explorer 9. It is also now available on GitHub.
Embedding a PDF using HTML markup
Embedding a PDF using the standards-compliant <object> element is actually rather simple, and looks like this:
<object data="myfile.pdf" type="application/pdf" width="100%" height="100%"> <p>It appears you don't have a PDF plugin for this browser. No biggie... you can <a href="myfile.pdf">click here to download the PDF file.</a></p> </object>
Note the <p> nested inside the <object>; this content will be displayed if the browser isn't capable of displaying the <object>. In this example, the 'fallback' content contains a link to the PDF, which allows visitors who don't have the Adobe Reader plugin to download the PDF and view it offline.
PDF Open Parameters
Adobe Reader provides a number of PDF open parameters that allow you to control how a PDF file is displayed when opened. Options include zoom level, jumping to a page number, highlighting search terms, and selecting which toolbars will be visible. Read more about PDF open parameters here.
Not comfortable writing your own code?
Use the code generator. Simply fill out the form and the generator will provide you with standards-compliant markup you can copy and paste into your HTML file. The code generator can also automatically generate the PDF open parameter code for you. It's really convenient, and completely free! Click here to use the generator.
- PDF filling entire browser window
- PDF embedded in a <div> with size and position controlled by CSS (single <div>)
- PDF embedded in a <div> with size and position controlled by CSS (two columns)
Results from internal testing of PDF embedding using the <object> element. Please note that pages were only tested using Adobe Reader; no open-source PDF browser plugins were used during testing.
|Mac OS X 10.5
|Internet Explorer 6||X||not applicable||not applicable||not applicable|
|Internet Explorer 7||X||X||not applicable||not applicable|
|Mozilla Firefox 3||X||X||no Adobe Reader plugin||X|
|Apple Safari 3.1||X||X||X||not applicable|
|Opera 9.5||X||X||no Adobe Reader plugin||NO|
not applicable: Specified browser is not produced for this operating system.
no Adobe Reader plugin: Adobe Reader unavailable for this browser/OS combination.