PDF Icon in SharePoint

By | 2010-08-27

This one has been long overdue. There are ton’s of posts and manuals on how to add the PDF Icon to SharePoint. But I wanted an even simpler solution. Litterly one solution!
So here it is!
I have created a simple Farm solution. With just one Farm Feature.
When activated it will add the PDF icon to the infamous DOCICON.xml and upload the PDF Icon itself off course.

And then you will have the PDF Icon for your PDF documents.

Download the solution here.
If you want to index the contents of a PDF file with SharePoint search, don’t forget to install the Adobe PDF iFilter or the Foxit PDF iFilter ( my favorite ).
Install the solution ( from within the SP2010 Powershell window ) and as Farm Admin!

Here is the code from the solution to add the PDF Icon xml element to the DOCICON.xml and to all the Search Applications of the Farm. I also added the removal code in the FeatureDeactivating code in the solution itself!

5 thoughts on “PDF Icon in SharePoint

  1. Pingback: Twitter settimana del 2010-11-14 — .mark.net il blog di Marco Trova

  2. Pingback: Twitter settimana del 2010-11-14 — .mark.net il blog di Marco Trova

  3. Stef van Hooijdonk Post author

    No, this works for a single server farm only. It would need to be rewritten to a Timer Job to be able to change all front ends in a Farm

  4. Robert

    Nice article!

    You can avoid quite a bit of work by doing 2 things:

    1. Deploy your image using a mapped folder (I use TemplateIMAGES since it’s the default for those kind of things.

    2. Use SPUtility class (GetGenericSetupPath) to get the SharePoint path instead of working with great-great-…-grand-parents for directories.

    You can get an other good writeup about it at: http://blogs.msdn.com/b/sgoodyear/archive/2008/06/14/updating-the-docicon-xml-file-with-a-feature.aspx

    Robert / nitront.com


Leave a Reply

Your email address will not be published. Required fields are marked *