Tuesday 10 February 2009

MOSS 2007 PDF ICON

Adding the .PDF Icon to MOSS 2007


How many SharePoint projects have you done where a week after the implementation, you get an email from the customer about the .PDF icon not existing in document libraries.

By now you probably no doubt know how to resolve the problem,

  1. Download This is the icon from Adobe.

  2. Save to TEMPLATE\IMAGES directory. (DEFAULT: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\template\images)

  3. Open the file docicon.xml. (DEFAULT: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\template\xml\docicon.xml)

  4. Add a new Mapping element to the ByExtension element.


    NOTE: Be sure to change pdficon_small.gif to whatever image you downloaded to represent pdf documents.

  5. Save the edited docicon.xml file.
  6. Restart IIS (iisreset /noforce).

Thats a fine fix and not too manual compared to some other fixes that are repeatedly done but recently ive been working on minimizing the amount of time i need to spend doing these tasks and writing some batch files to simplify manual fixes like this.

I have zipped up this fix so you can download it.

Download it here

the zip file contains
  • DOCICON.XML (with ammendments)
  • PDF16.Gif
  • PDFICON.BAT
the bat file does 4 things:

copy pdf16.gif "c:\program files\common files\microsoft shared\web server extensions\60\template\images\pdf16.gif" /y

this line copies the file into the images folder on the SharePoint server

rename "c:\program files\common files\microsoft shared\web server extensions\60\template\xml\docicon.xml" docicon.old

this line renames DOCICON.XML so that it can be restored if required

copy docicon.xml "c:\program files\common files\microsoft shared\web server extensions\60\template\xml\docicon.xml" /y

this line copies across the new DOCICON.XML file

iisreset /noforce

Resets IIS committing the changes

How to use

Extract the zip file to anywhere on your front end server(s) and run "pdficon.bat."


Ryan!

No comments:

Post a Comment