Adding PDF icon to SharePoint Document Libraries

One of the missing features in MOSS 2007 is the ability to recognize PDF files in a document library. It can be frustrating when all you see is a blank page icon instead of SharePoint recognizing the document type properly. This is a common portal issue that is easily remedied with a bit of extra configuration. Here is an example of how PDF items are normally displayed inside of a library view.


Missing Icon Example

Following the Microsoft KB you can see that you need to edit the docicon.xml file located at the path C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\XML


Docicon XML

The Docicon.xml configuration file is a listing of all document types that are supported by SharePoint. To support the PDF icon, you need to add the following Mapping XML element to the XPath //DocIcons/ByExtension. The Mappings are listed in alphabetical order, so you should insert the PDF mapping accordingly.

<Mapping Key="pdf" Value="pdficon.gif"/>

Here is the Docicon.xml file after the edit.


Docicon XML View

pdficonThe next step is retrieving the small PDF icon from Adobe. When you have download the icon image, you need to save the image as “pdficon.gif” to match the mappings entry we created earlier. The last step is to copy the PDF icon image to the SharePoint template images path: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\IMAGES\pdficon.gif. This is the location where SharePoint will search for document type icons for rendering in document library views – according to the configured file extension mappings in docicon.xml.


pdficon View

After these steps have been completed, you can now visually distinguish the document type for PDF extensions with a quick icon type indicator.


PDF Icon Appears

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Twitter

Filed under: Application Development, Microsoft | Posted on November 16th, 2009 by AaronH

Tags: , , , ,

Leave a Reply

Links

Topics

Tags

Authors

Syndication

Archives

Copyright © 2012 Pearl Technology. All rights reserved.
The Tech Blue theme was modified to help create this blog.