Wednesday, April 8, 2009

PDF icon in SharePoint

Now that you finally have Windows SharePoint up and running on SBS 2003 or SBS 2008 via (companyweb) you start uploading documents. When you upload Microsoft Office Documents like Word and Excel you see a nice icon next to the document, however when you upload an Acrobat document (PDF) you don’t.

 

image_2_548C42BE

 

As you can see from the above screen shot there are 3 files in document library. The bottom two being Excel and Word files automatically have a little icon to the left denoting the type of file, however the first file is actually a PDF and as you can see there is no distinguishing icon.

 

Unfortunately by default SharePoint doesn’t include a PDF icon, however with a little bit of configuration you can add it. Here’s how:

 

Firstly, you’ll need to download a suitable PDF icon to use. A good one can be found at:

 

http://www.adobe.com/images/pdficon_small.gif

 

and looks like:

 

 

Download the file and save it into the directory c:\program files\common files\Microsoft shared\web server extensions\12\template\images on the SharePoint server.

 

Next locate the file c:\program files\common files\Microsoft shared\web server extensions\12\template\xml\docicon.xml on the SharePoint server. Right mouse click on the file and select edit.

 

image_6_548C42BE


Locate the <ByExtension> element where you will see entries for each icon starting with <Mapping key=”…. Enter the following on a new line:

 

<Mapping key=”pdf” Value=”pdficon_small.gif” OpenControl=””/>

The name of the file must match the name of the PDF icon you downloaded. Note that the extension names in the docicon.xml file do not have to be in alphabetical order so it is best to place the entry at the end of the existing list.

 

When complete, save the file and exit the editor.

 

Go to the DOS prompt on the SharePoint server via Start | Run | Cmd and type iisreset to restart IIS.

 

If you now refresh the page you should find the PDF icon displayed like so:

 

image_8_02799577 

Just because you have now have a PDF icon doesn’t mean that your PDF documents will be indexed by SharePoint (which is possible). That also needs to be configured, but that’ll be the subject of a future post.

 

This information can also be found in my Windows SharePoint Operations Guide along with exactly how to configure PDF search. Not only that the Guide has a vast array of information about not only installing and configuring SharePoint but also how to get some of the best add-ons for SharePoint up and running to provide your installation with additional value and functionality.