How to Display a PDF File in a HTML Web Page

By Contributing Writer

Using hyperlinks on your Web page you can easily display Word documents, images, Flash movies and even PDF documents. Quickly and easily use simple HTML code to link to a PDF document. Alternatively, you can embed a PDF in an HTML page.

Step 1

Save the PDF you wish to link to on a local drive on your computer.

Step 2

Upload the PDF to your Web host. How this is done depends on your host. If you have any problems, check your host's FAQ or customer service. Take note of the path of the file.

Step 3

Type the following code to cause the PDF to display in a new window:<a target=\"_blank\" href=\"filename.pdf\" title=\"\">Text that appears to the user</a> If you do not wish the PDF to open in another window, then type: <a href=\"filename.pdf\" title=>Text that appears to the user</a>For "filename.pdf" substitute the filename and path of your PDF on the Web host, relative to the current HTML page. Include the quotes. For "Text that appears to the user," substitute the text you want to appear highlighted and clickable.

Tips & Warnings

  • To embed the PDF in the HTML window, point the page to a document and then specify the height and width of the PDF so the HTML window is the correct size using the code:
  • <embed src=\"filename.pdf\" width=\"500\" height=\"375\">. Note that an embedded PDF may look very different on different browsers and operating systems.