Learn more about SQL Server tools

mssqltips logo
 

Tutorials          DBA          Dev          BI          Career          Categories          Webcasts          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Webcasts

DBA    Dev    BI    Categories

 

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


By:   |   Read Comments   |   Related Tips: > Sharepoint

Attend this free live MSSQLTips webcast

Tips and Tricks to Growing Your SQL Server Estate from SMB to Enterprise Scale
Thursday, June 28, 2018 - click here to learn more


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.


Last Update:


next webcast button


next tip button



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.

View all my tips





Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Email me updates 


Signup for our newsletter
 I agree by submitting my data to receive communications, account updates and/or special offers about SQL Server from MSSQLTips and/or its Sponsors. I have read the privacy statement and understand I may unsubscribe at any time.



    



Learn more about SQL Server tools