The other day, I was asked to debug the “Tagged Items” web part within SharePoint 2010. You can see this web part in action when clicking on a tag, in someones profile page. The link then takes you to tagprofile.aspx page, and shows you(by default) 60 days worth of tagging of the specfied tag / keyword.
The problem was PDF icons didn’t didn’t seem to work correctly. The first thing that came to mind was the DocIcon.xml, which I knew by default doesn’t have any entry’s for PDF Documents. So I went ahead and added this line to the DocIcon.xml : <Mapping Key=”pdf” Value=”pdficon.gif”/>
Then I reset IIS and as expected in document library’s, I now showed a PDF Icon instead of the blank / default icon. However when I clicked the tag it still showed the red x next to the document title. I thought for a second, and then remembered that when SharePoint needs the larger icon, for a specified extension, it will append ”lg_” to whatever is listed in the DocIcon.xml. In my example this file name would be “lg_pdficon.gif”. Since I did not place the larger size icon file in the /images folder, this icon would not render. One I did, it rendered correctly.
The moral of the story is make sure you name your PDF file with a standard name ex: “pdficon.gif” this way SharePoint will be easily be able to reference the large icon by “lg_pdficon.gif” . The main reason for calling out the standized naming convention is because many of the PDF document walk thoughs on the internet use pdficon_small.gif as the name. Which when you add “lg_pdficon_small.gif ” seems a bit weird to me…
Notes**
The small icon should be 16×16 and the large should be 32×32.
Adobe Linking site. ( all the PDF icons you will every need… ) : http://www.adobe.com/misc/linking.html
More information about DocIcon.xml : http://msdn.microsoft.com/en-us/library/ms463701.aspx
Let me know if you have any troubles. Thanks!!
