Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Recommended way to embed PDF in HTML?

What is the recommended method for embedding PDFs in HTML?
iFrame?
Object?
Embed?
What does Adobe say about itself?

In my case, PDFs are generated quickly, so it can't be uploaded to third-party solutions before you delete them.
by

2 Answers

ninja01
This is quick, easy, to the point and doesn't require any third-party script:

<embed src="samplewebsiteurl/the.pdf" width="500" height="375"
type="application/pdf">
RoliMishra
Using both <object> and <embed> will give you a wider breadth of browser compatibility.

<object data="yoursite.com/the.pdf" type="application/pdf" width="750px" height="750px">
<embed src="yoursite.com/the.pdf" type="application/pdf">
<p>This browser does not support PDFs. Please download the PDF to view it: <a href="yoursite.com/the.pdf">Download PDF</a>.</p>
</embed>
</object>

Login / Signup to Answer the Question.