In one of the projects, I had to display PDF icon whenever users uplaods a PDF file.Apparently, no coding efforts needed to achieve this.
PART 1: Central Administration
i) Go to Central Administration > Shared Services > Search Settings > File Types >Add File Type.
ii) Enter ‘pdf’ as a file extension and save.
iii) Perform the full index crawl.
PART 2: Images and XML
i) IMAGES: Go to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES and copy the PDF icon (from internet) and name it pdfIcon.gif.
ii) C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML and open the file in notepad.
iii) Add a new entry under <ByExtension>
<Mapping Key="pdf" Value="pdfIcon.gif" />
and that's it.
Please note we can do it only on development environment and/or test server. If on production server does not have PDF logo, we need to contact SharePoint administrators or the infrastructure team.