Saturday, January 23, 2010

Display PDF File in MOSS Portal

Steps to display PDF file in a MOSS / Sharepoint Portal
Usually, when i get down to write a blog, i tend to get creative and put a lot of language around it. This time, i am going to cut the crap and get straight to it.
I want to display a PDF file in my MOSS Portal. So how do i go about it?
Following are some simple approach that your dev team can take.
1. Upload the pdf to a doc library
Add a Content Editor Web part to your web site
Copy paste the below code to the HTML mode in the content editor
< embed height=”500px” width=”500px”
src=”http://siteurl/test.pdf” type=”application/pdf”>
2. Use a simple page viewer web part and give the path of the pdf file in the document library
3. Many a case, the user will want to dynamically pick the pdf file based on some parameter. This was my case too. A simple web part will do the trick for this. Create a custom web part that spins out the HTML mentioned in approach 1. With a difference that the url of the pdf file will be generated at the run time based the business requirement.

No comments:

Post a Comment