This question cropped up a couple of times in the comments to the Adobe PDF Indexing blog post

How do you open a PDF in a web page on SharePoint?

Here is the method I use. There may be prettier and better ways to do it. If you know of one, please add a comment.

The short version:

  1. Take one Content Editor web part
  2. Enter <embed> tags containing the PDF fie as the source

The longer version:

  1. Upload the PDF you want to display to a SharePoint library. From within the library, right click the PDF file name and select ‘Copy Shortcut’ (this takes a copy of the full URL to the file)
  2. Add a ‘Content Editor’ web part to a SharePoint web page.
    • If you’re using SharePoint 2007, it’s in the Miscellaneous group in the web part gallery
    • If you’re using SharePoint 2010, it’s in the Media and Content group in the web part ribbon
  3. Edit the web part to insert your code
    • SharePoint 2007 – Modify the web part and click the Source button in the task pane (not the Rich Text Editor button)
    • SharePoint 2010 – In the ‘Format Text’ ribbon, click the HTML Editor button
  4. Insert the code
    • Click CTRL + V to paste the shortcut to the PDF file
    • Then add the following code, using your shortcut in place of FILENAME.PDF
       <object><embed src="FILENAME.PDF" height="600" width="600"
       type="application/pdf"></embed></object>

      Here’s an example:

    • Click OK/Save to save the code and then OK to save the web part
  5. You should now see your PDF file displayed in the web part. If required, adjust the height and width values until the PDF is displayed how you want it (preferably one full page in view). In SharePoint 2010, the code may have been modified a little – don’t panic.
  6. Save and publish your page (or Stop Editing, depending on what site template and version of SharePoint you are using)

Hey presto: One PDF document viewed inside a SharePoint web page. Cue free advertising for the last PDF that arrived onto my computer :-)

Notes:

You must use the Content Editor web part for this task. If you try adding <embed> tags to a standard page control (for embedded content within the page), SharePoint will remove the tags when the page is saved and your hard work will disappear. If you’re running SharePoint with extra strong mints security, you may also find the <embed> tags are stripped out when attempting to save your work.

People will still need a PDF reader installed on their client in order to view the PDF embedded in the web page, just the same as when visiting any other web site with embedded PDFs.

Update 30th Apr 2012: Beware the dreaded 64-bit edition of IE. I’ve seen it cause challenges with various different software and web site features. Add this one to the list – more details kindly shared by Terri in the comments.