SharePoint (2003 thru Online): November 2016

Wednesday, November 2, 2016

PDF Files Issue in SharePoint 2010

In SharePoint 2010 document libraries, the PDF’s that have been uploaded do not show the correct icon and only give you the option to save instead of opening them.



The below PowerShell script downloads a icon GIF image from Adobe named pdficon_small.gif, places it in the images folder under the 14 hive, associates it in the DOCICON.XML file, sets Browser File Handling to Permissive, and then runs IISReset.
                                           The pdf icon was downloaded to the IMAGES folder.

             The PDF Key was added to the DocIcon.XML with this PDF GIF image icon file.

Browser File Handling to "Permissive" will enable the PDF’s to be opened instead of only saved. 

PDF docs now have the correct icon and are allowed to be opened.

Microsoft KB Article related to PDF Issue in SharePoint.
________________________________________________________________________

We can also enable opening PDF files is by adding the pdf extension to the allowed MIME types of the web application.

VIEW
$webApp = Get-SPWebApplication "http://sp2010dev/"
$webApp.AllowedInlineDownloadedMimeTypes

ADD
$webApp = Get-SPWebApplication "http://sp2010dev/"
$webApp.AllowedInlineDownloadedMimeTypes.Add("application/pdf")
$webApp.Update()

REMOVE
$webApp = Get-SPWebApplication "http://sp2010dev/"
$webApp.AllowedInlineDownloadedMimeTypes.Remove("application/pdf")
$webApp.Update()