Friday, March 28, 2014

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 



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...