Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to embed a PDF file in a web site?

Tags:

html

pdf

embed

I simply want to embed a PDF file in a web site.

The best solution I've found is Google Docs Viewer (http://docs.google.com/viewer), but it does not work for IE and obviously that is not going to work for me.

Anyone have a clean, easy solution to this?

Update: I should add that one of the benefits of embedding the PDF file the Google viewer way is that as the PDF file I link to gets updated (and it could without notice to me), my site would automatically be holding the same PDF file (provided the full pathname doesn't change, which it does not). For this reason converting the file to an image is not preferred while.

like image 461
JWM Avatar asked Nov 02 '10 22:11

JWM


People also ask

Can you embed a PDF on a website?

Fortunately, Adobe has released Adobe PDF Embed API (PDF Embed), an easy way for you to incorporate a PDF directly into your website with just an easy snippet of code. It is entirely free to use and renders client-side within your web app. You don't have to learn a sophisticated PDF library, and it is super easy to do.

How do you embed a PDF in HTML website?

The easiest way to put PDF in an HTML document is using the <a> tag with its href attribute. You need to add the URL or the reference link of your PDF file to the element.

How do I display a PDF on a Web Page?

Generally, a hyperlink is used to link a PDF document to display in the browser. An HTML anchor link is the easiest way to display a PDF file. But if you want to display a PDF document on the web page, PDF file needs to be embedded in HTML. The HTML <embed> tag is the best option to embed PDF document on the web page.

How do I turn a PDF into an embedded link?

Choose Tools, click on Edit PDF, then on Link, and finally, select Add/Edit Web or Document Link. Select the area that you want to hyperlink. Then, in the Create Link dialog box, choose the options you want for the link appearance and click on the Open a Web Page button for the link action.


1 Answers

If you do stick with the pdf embedded option, Byron is right although embedded pdf files don't look so great on a webpage. Anyway, be sure to be strict about the coding. Hence:

<iframe src="path/to/pdf" width=500 height = 700>

Should be

<iframe src="path/to/pdf" width="500" height="700">

Small alteration.

like image 188
Quazi Avatar answered Oct 26 '22 16:10

Quazi