SharePoint 2013: How to View PDF Files in Browsers

Recently someone expressed his requirements to open  files in the browser the same way as Excel file opens up when we use Excel services. Although the settings were to open the file in the web browser in advanced settings of the document library it was opening in the client application. After some digging into this issue, it was managed to be done. Here are the steps to get this done:

  1. Open the document library where you have stored the .pdf file.
  2. Go to the advanced settings and make sure that you have selected "Open in web browser" and not in the client application.
  3. Login to Central Administrator--> Application management --> Web Application general settings and select your web application.
  4. Then select your web application --> general settings and change browser file handling to Permissive from strict as shown below.

  1. Click OK and there you go.

The second, more secure way of displaying PDFs in the browser is to explicitly add the PDF MIME type to the Web Application's AllowedInlineDownloadMimeTypes list. This is accomplished via the SharePoint Management Shell:

  1. Run the SharePoint Management Shell
  2. Execute the following PowerShell cmdlets, replacing http://webAppUrl with the Web Application URL.
$webApp = Get-SPWebApplication("http://webAppUrl")$webApp.AllowedInlineDownloadedMimeTypes.Add("application/pdf")$webApp.Update()

Given the browser either supports native PDF viewing (Chrome, Firefox) or has a plugin (Internet Explorer), PDFs will be viewed in the browser.

Other Languages

This article is also available in the following languages: