Jump to content

Open Pdf within a section of a page.


jkkenzie

Recommended Posts

Can i open a pdf within a page? e.g. within <td> or <table> of htmls so that it appears on a section of a page where someone can just read through and still able to browse the web page. I dont want the PDF downloading or taking the whole page or even opening a new window and filling it.

 

Thanks in advance.

 

Link to comment
https://forums.phpfreaks.com/topic/213979-open-pdf-within-a-section-of-a-page/
Share on other sites

Embedding a PDF using <object> element is actually rather simple, and looks like this:

 

<object data="example.pdf" type="application/pdf" width="100%" height="100%">

 

  <p>It appears you don't have a PDF plugin for this browser.

  you can <a href="example.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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.