In this post we will discuss about how we can open pdf documents in web browser in SharePoint 2010. Also you can check out my previous posts on:
By default when you open a pdf document it will ask a dialog box to save or cancel the document. But if you want to open the document in the browser directly then we need to do some change in the central administration and also you can do this by using PowerShell.
Follow below steps:
Open SharePoint 2010 Central Administration, then from the Application Management section click on Manage web applications.
Then from the WebApplications page, Select the particular web application and from the Ribbon select General Settings as shown in the fig below:
Then from the General Settings page, Navigate to the Browser File Handling section. Here there are 2 options:
Permissive: Permissive Specifies no headers are added, which provides a more compatible user experience.
Strict: Strict adds headers that force the browser to download certain types of files. The forced download improves security for the server by disallowing the automatic execution of Web content that contributors upload.
By default Strict option is enabled, Change to Permissive as shown in the fig below.
Now it should work. Now the pdf file should open in the browser.
You can also do by using PowerShell:
$webApp = Get-SPWebApplication http://WebAppURL
$webApp.BrowserFileHandling = "permissive"