Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display Adobe pdf inside a div

Tags:

html

acrobat

I have a pdf file that the user has to see and click on the "I agree" button. How do you display a pdf inside a div?

like image 820
Phillip Senn Avatar asked Apr 29 '10 19:04

Phillip Senn


People also ask

How do I display a PDF in CSS?

src = 'bar. pdf'; ...it will work.

How do I view a PDF embedded?

Using an iframe tag is the second way to embed a pdf file in an HTML web page. In web development, web developers use the iframe tag to embed files in various formats and even other websites within a web page. Due to its wide compatibility, the iframe tag is widely used for embedding pdf.

Can I embed a PDF within a PDF?

For example PDF/-A2-compliant PDFs support inserting other PDF/A-compliant files, while PDF/A-3-compliant PDFs can support any file type as an attachment. To attach a file, go to Insert > Attach File in PDF. To embed a file, go to Insert > Embed File in PDF.


2 Answers

Yes you can.

See the code from the following thread from 2007: PDF within a DIV

<div>     <object data="test.pdf" type="application/pdf" width="300" height="200">         alt : <a href="test.pdf">test.pdf</a>     </object> </div> 

It uses <object>, which can be styled with CSS, and so you can float them, give them borders, etc.

(In the end, I edited my pdf files to remove large borders and converted them to jpg images.)

like image 72
Ron Knee Avatar answered Sep 21 '22 15:09

Ron Knee


Here is another way to display PDF inside Div by using Iframe like below.

<div>    <iframe src="/pdf/test.pdf" style="width:100%;height:700px;"></iframe>  </div>  <div>    <!-- I agree button -->  </div>
like image 39
Sudhir Bhapkar Avatar answered Sep 19 '22 15:09

Sudhir Bhapkar