How to open PDF files in browser and set file type association icons in SharePoint 2010?


SharePoint 2010 Won’t Open PDFs

I was searching on the internet for the reason of this issue and fixing it so I found the following it worked with me fine and witout any needing to restart IIS

The reason

  • First Looks like IIS is adding the http header X-Download-Options: noopen which forces the browser to download the file instead of opening it.   This new header is used by IE 8 to protect from script injection attacks.

Scenario:

How to open PDF files in browser and set file type association icons in SharePoint 2010?

Explanation:

Those who have experience with SharePoint 2010 may have noticed that pdf files in SharePoint 2010 do not open in browser by default. SharePoint 2010 throws a prompt to save the pdf file.
This is by behavior in SharePoint 2010 and is very annoying especially when you have a requirement to show a pdf file in a Page Viewer Web Part, etc…

Luckily there is a workaround to fix this issue.

Open Central Admin > Application Management > Manage Web Applications.
Choose a web application and click “General Settings”.

Scroll towards the bottom of the page until you find the section “Browser File Handling”.
Change the option from “Strict” to “Permissive”.

Go back to the document library and click on the pdf file. It should open in the browser. (Perform an IISRESET if required.)

You may also have noticed that the icons for pdf files do not show up by default in SharePoint 2010.go to the following link to solve this problem

https://profadmins.com/2012/03/20/adobe-pdf-ifilter-indexing-with-sharepoint-2010/

for further details go to

http://underthehood.ironworks.com/2010/09/how-to-open-pdf-files-in-browser-and-set-file-type-association-icons-in-sharepoint-2010.html

http://www.adobe.com/special/acrobat/configuring_pdf_ifilter_for_ms_sharepoint_2007.pdf

Enhanced by Zemanta
Advertisements

Adobe PDF IFilter Indexing with SharePoint 2010


This note explains how to enablePDF indexing using the Adobe IFilter version 9.0 in Microsoft SharePoint 2010.
  1. Download PDF icon picture from Adobe web site http://www.adobe.com/misc/linking.html  name it ex: pdf16.gif  and copy to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES\ 
  2. Add the following entry in docIcon.xml file, which can be found at: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML
    <Mapping Key=”pdf” Value=”pdf16.gif” />

Now add PDF as a file type:

  • Run Central Administration.
  • Click Manage service applications under “Application Management”:
  • Click the Search Service Application link in the list of applications.
  • Click File Types  under “Crawling” in the left navigation area:
  • Click New File Type.
  • Enter pdf for the “File Name Extension” and click OK.
  • Using Regedit on the server, navigate to

\HKEY_LOCAL_MACHINESOFTWAREMicrosoftOfficeServer14.0SearchSetupFilters

  •  Right-click the Filters  folder and select New Key. Enter “.pdf” for the key value.
  • Add the following values to this key:

<REG_SZ> Default =<value not set>
<REG_SZ> Extension = pdf
<REG_DWORD> FileTypeBucket = 1
<REG_SZ> MimeTypes = application/pdf
The key should look like:

  • Navigate to: \HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupContentIndexCommonFiltersExtension
  •  Right-click the Filters  folder and select New Key. Enter “.pdf” for the key value.
  • Set the “default” value to {E8978DA6-047F-4E3D-9C78-CDBE46041603}

The key should look like:

You can now add an image to beused for the icon for PDF documents:

  • Add an image (typically gif or png, use Google images to find an example) for the PDF icon to the folder:

C:Program FilesCommonFilesMicrosoft SharedWeb Server Extensions14TEMPLATEIMAGES

  •  Open the file docicon.xml from the location:

C:Program FilesCommonFilesMicrosoft SharedWeb Server Extensions14TEMPLATEXML

  •  Add a link to map the pdf extension to the image by adding a link like the following to the ByExtension element:

<Mapping Key=”pdf” Value=”pdf_icon.gif” OpenControl=””/>

  •  Finally, issue an IISReset and restart the Windows services “SharePoint Foundation Search V4” and “SharePoint Server Search 1”.
Enhanced by Zemanta