How to add PDF icons next to PDF documents in a SharePoint Library

By:   |   Comments   |   Related: > SharePoint Configuration


Problem

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?

Solution

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.
  1. Create or download 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

  2. 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)

  3. Add a new Mapping element to the "ByExtension" element as follows:

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

  4. Save the edited docicon.xml file.

  5. Restart IIS (iisreset /noforce).
Next Steps
  • Check out MSSQLTips.com for great information about Microsoft SQL Server.


sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip



About the author
MSSQLTips author Rob Fisch Rob Fisch has worked with SQL Server since version 6.5 as a dba, developer, report writer and data warehouse designer.

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips



Comments For This Article

















get free sql tips
agree to terms