How to add PDF icons next to PDF documents in a SharePoint Library
By default, SharePoint document libraries display graphical icons representing various Microsoft Office Applications (i.e. Excel, Word, etc.). All non-Microsoft documents are represented with a plain white square. How do I display a special icon for other document types?
There are 3 simple steps to adding graphical icons for non-Microsoft documents. These are to 1) add a graphic, 2) add a mapping to that graphic so SharePoint knows where to look for it and 3) restart the web service (IIS).
Below are instructions on how to add a graphic for PDFs. You can use this technique for other document types as well.
Note: These instructions make the following assumptions:
- The default location of your servers "Program Files" folder as "C:\Program Files". If that is not the case, adjust the instructions as needed.
- You are using WSS3 or MOSS2007.
- Create or
a small (approx. 17 x 17) icon that represents PDF documents.
Save the file to:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\template\images
- Find a file called docicon.xml in this location:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\template\xml\docicon.xml
Save a copy as a backup, then open it with a text editor (i.e. notepad)
- Add a new Mapping element to the "ByExtension" element as follows:
<Mapping Key="pdf" Value="pdficon_small.gif" />
- Save the edited docicon.xml file.
- Restart IIS (iisreset /noforce).
- Check out MSSQLTips.com for great information about Microsoft SQL Server.
Last Updated: 2010-08-19
About the author
View all my tips