Open PDF Documents in New Window in SharePoint

By default, PDF documents are opened in the same browser window in SharePoint. Here is the trick to open PDF files in new window:

Option 1: Open PDF in new window with jQuery
Use this jQuery to script to open SharePoint 2010 PDF documents in a new window:

<script src="https://code.jquery.com/jquery-1.7.2.min.js" type="text/javascript"></script>

<script>
$(document).ready(function() {
    $("a[href$='.pdf']").removeAttr('onclick').attr("target","_blank");
});
</script> 

This script can be placed in Master Page, in Script editor/Content editor web parts or as part of SharePoint 2013/2010 delegate controls!

Option 2: Configure Client Settings to Open PDF in Client Application instead of Browser
If Office Web Apps isn’t integrated with your SharePoint 2013, you can configure these options at client side:

  • Go to Adobe Reader >> Edit >> Preferences
  • Under Internet tab >> Uncheck : Display PDF in browser.
open pdf in new window sharepoint 2013

This will change the open in browser behavior to open in Adobe reader client application.

If that option isn’t available/doesn’t work for you, then configure IE to open PDF in Adobe reader instead of same window in Internet explorer. Here is how:

  • Go to Internet Explorer >> Tools >> Internet Options 
  • Under Programs tab >> Manage Add-Ons. >> Show : All Addons >> Then Disable the Adobe PDF plug-in.
open pdf in new window sharepoint

Option 3: Instruct Office Web Apps WordApp to Not to open PDF documents:
Don’t want your Office web apps to handle PDF documents? Want to open PDF documents in Adobe reader instead of Word web app? Well, you can Remove the PDF handler from word by running:

Get-SPWOPIBinding -Application "WordPDF" | Remove-SPWOPIBinding -Confirm:$false

To revert it back:

New-SPWOPIBinding -ServerName "was.crescent.com" -Application "WordPDF" -AllowHTTP 

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *