Sitecore media library missing PDF icons

When uploading PDF (or Word/Excel/…) documents to the Sitecore media library, the PDF icon is not shown:

PDF icon Missing

PDF icon Missing

In this case it is only my test server that is not showing the icons. My local development machine (my own laptop) displays the icons perfectly:

PDF icon Shown

PDF icon Shown on my laptop

The reason is that Siteore use the associated icon from the OS. Acrobat Reader is installed on my laptop, not on my test server. So the test server displays a default icon instead.

WHAT’S THE SOLUTION THEN?

You can specify which static file to use for which extension in the web.config. To add the PDF icon, do the following:

Download a .pdf icon from the Adobe Website (due to licensing restrictions, Sitecore is not shipped with an Acrobat Reader icon). Place the icon wherever you wish.

Go to the web.config and find the <mediaType name=”PDF file” extensions=”pdf”> section.

Add the following:

<mediaType name="PDF file" extensions="pdf">
  <mimeType>application/pdf</mimeType>
  <forceDownload>false</forceDownload>
  <sharedTemplate>system/media/unversioned/pdf</sharedTemplate>
  <versionedTemplate>system/media/versioned/pdf</versionedTemplate>
  <!-- New section -->
  <thumbnails>
    <generator type="Sitecore.Resources.Media.MediaThumbnailGenerator, Sitecore.Kernel">
      <extension>png</extension>
    </generator>
    <staticFile>File location. For example /sitecore/shell/Themes/pdficon_large.png</staticFile>
  </thumbnails>
  <!-- end:New section -->
</mediaType>

Clear the following folders:

  • /temp/ folder (at least all files named “fileIcon”)
  • The Sitecore media cache (default located at /app_data/mediacache/)

Clear your browser cache.

Restart the website.

That’s it. You now have PDF icons in Sitecore.

MORE READING:

About briancaos

Developer at Pentia A/S since 2003. Have developed Web Applications using Sitecore Since Sitecore 4.1.
This entry was posted in Sitecore 6, Sitecore and .net and tagged , , , , . Bookmark the permalink.

3 Responses to Sitecore media library missing PDF icons

  1. Eelko Heuvelmans says:

    Ha Brian, i noticed this to, but i tend to remember this was not always the case. I think i have seen the icon in earlier versions of Sitecore (on servers without pdf reader) or is this just my imagination?

    Like

  2. briancaos says:

    I remember Sitecore 4 to have a PDF icon, but Adobe have changed their licensing rules, so you are not allowed to ship your product with a PDF icon, as Adobe states: “You may not use Adobe product icons except under a written license from Adobe.You may qualify for use of an Adobe product icon(s) under a program offered through an Adobe Partner program. If you are not eligible for any of these programs, you may be eligible to use one of Adobe’s web logos or a box shot of an Adobe product instead.” (http://www.adobe.com/misc/linking.html)

    Like

  3. Peter says:

    Our Sitecore 8.2 instance has had a PDF icon at /-/icon/WordProcessing/16×16/imp_exp_pdf.png. It’s been there for as long as I can remember. Is this not the Sitecore default?

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.