How to Put a PDF Document on Your Website

There are two ways to put a PDF on your website: You can add a link to one or embed an actual PDF document inside a Web page. The method you choose depends on your design goals. If you have a PDF that you always want visible, embedding it might be a wiser option. On the other hand, you may not wish to load a PDF into a Web browser if a user might not need to see it. Using HTML, you can link or embed a PDF on your website.

Step

Launch an HTML editor and open an HTML document.

Step

Paste this code into that document's "body" section:

Step

Your browser does not support PDFs

Step

The "object" tag embeds a PDF into the Web page. Replace "xyz.pdf" with the URL of a PDF that resides on the Web. For instance, if the PDF is on your own Web server and the PDF's URL is "http://www.MyServer.com/Test.pdf," make the code appear as follows:

Step

<object class="pdf" data=""http://www.MyServer.com/Test.pdf " type="application/pdf"> Your browser does not support PDFs

Step

Note that the object tag references a CSS class named "pdf."

Step

Place the following HTML code below the previous code:

Step

<a href=”xyz.pdf">View external link to PDF

Step

This creates a hyperlink. Replace “xyz.pdf” with the same URL to the PDF you specified previously.

Step

Paste the code shown below in the document's "head" section:

Step

Step

This creates the "pdf" class referenced by the object tag in the body section. This class allows you to set the PDF's height and width. In this example, those values are 400 pixels and 500 pixels. Change these to other values to change the dimensions of the PDF viewer.

Step

Save the document and open it in a browser. The PDF appears. Click the link that appears on the page. Your browser navigates to the same PDF document.