Displaying a PDF file on your Webpage

PDF files or Portable Document Format files have provided a fairly secure way for users to publish information. This is because it represents a way for a document to be distributed without fear of it being edited and thus compromising the data it contains. The PDF format is often used for Newsletters, Reports, Whitepapers, etc.

As such, websites regularly need to display PDF files on their pages. Putting it into a page is somewhat simple and there a couple of ways to do it. The easiest way is to link to the document. By using

< a href=”myreport_20100101.pdf” >My report on the January 1, 2010< /a >

You can provide a link to the document which will open in the browser. However, this brings up a few small problems.

1. To go back to the previous page, the user is forced to use the BACK button.

2. If the user makes a bookmark on the PDF file and comes back at a later time to visit the bookmark, there will be no link back to the original site.

To circumvent this you can load the PDF as an embedded object. For example, using the following code will open the PDF within the web page.

< object
data = ” myreport_20100101.pdf “
type = “application/pdf”
width = 600 height = 400 >< /object >
My report on the January 1, 2010

This will allow for seamless integration of PDF files on website and also not detract from the overall design of the website.

This entry was posted on Thursday, May 20th, 2010 at 9:52 pm and is filed under Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply