Use Windows PowerShell commands to adjust settings so that PDFs open in the program you want.
When users open a PDF file from a SharePoint document library that uses Office Web Apps Server, the default behavior is to open the PDF in Word Web App. If this isn’t the behavior you want, or if your users are having trouble opening PDFs on smartphones, you can use Windows PowerShell commands to make PDFs open in your default PDF reader instead. Here's how:
Step 1: Open an elevated SharePoint 2013 Management Shell
On the computer running SharePoint Server 2013 or SharePoint Foundation 2013, open an elevated SharePoint 2013 Management Shell. Choose the procedure that corresponds to your server operating system:
-
In Windows Server 2008 R2:
-
On the Start menu, select All Programs.
-
Select Microsoft SharePoint 2013 Products.
-
Choose (right-click) SharePoint 2013 Management Shell to display the shortcut menu.
-
From the shortcut menu, choose Run as administrator.
In Windows Server 2012:
-
Swipe in from the edge of the screen to show the charms and then choose Search to see all the applications that are installed on the computer.
-
Choose (right-click) SharePoint 2013 Management Shell to display the app bar.
-
In the app bar, select Run as administrator.
Step 2: Run the Windows Powershell Command
At the Windows PowerShell prompt, enter one of the following commands, based on what you want to do:
-
To adjust the binding so that smartphones won’t try to view PDFs in Word Web App (but other devices will continue to), enter the following command and then press Enter:
Get-SPWopiBinding -Action "MobileView" -Application "WordPDF" | Remove-SPWopiBinding -Confirm:$false
-
To remove the binding altogether so that PDFs open in the default PDF viewer on all devices, use the following:
Get-SPWOPIBinding –Application "WordPDF" | Remove-SPWOPIBinding -Confirm:$false
Going back
If you change your mind and later want to have PDFs open in Word Web App again, follow the same procedure as above, but in Step 2, run these two commands:
Get-SPWOPIBinding –Application "WordPDF" | Remove-SPWOPIBinding -Confirm:$false
New-SPWOPIBinding –ServerName "Server.corp.Contoso.com" –Application "WordPDF" -AllowHTTP
Be sure to use your own Office Web Apps server name instead of “Server.corp.Contoso.com.”
Resources
Use Windows PowerShell to administer SharePoint 2013
-Chris
Nice tip. Thanks for sharing.
@Paul, yes, the bindings are very configurable. For example, to remove all bindings to the Word Web App, you can use this command:
Get-SPWOPIBinding -Application "Word" | Remove-SPWOPIBinding -Confirm:$false
Or substitute "Excel" in place of "Word" to remove bindings to the Excel Web App.
You can also remove bindings for specific file name extensions (such as .doc or .dotm), or specific actions, like "view" or "edit". See the Remove-SPWOPIBinding link under "Resources" above for all the options.
-Chris
Thanks, very helpful
thank you indeed
Is there a similar command to force Word and Excel documents to open in the full defautl application (MS Office) rather than the web app?
Thanks so much.
Hello Chris Downs, I only use the Office Web App Server without Sharepoint. Its WordPDF enable it? For viewing online?
We aren't running server version. How do I change it for my laptop only?
Hi Chris,
This info doe not apply to SharePoint for Office 365, correct? Any way to adjust the application binding with Office 365? Thank you.
Hi Paul,
That's correct, this post only applies to the on-premises Office Web Apps Server product and how you configure it with SharePoint 2013. In Office 365, you can turn the Office Web Apps off for a document library, but you can't configure individual bindings. Also, Office 365 does not provide the feature where PDFs open in Word Web App; PDFs will always open in your default PDF program when you open them from an Office 365 document library.
If you want to turn off the Office Web Apps for an Office 365 document library, use the following procedure.
1. In the document library, choose Settings (the gear menu) and then "Site Settings."
2. Under "Site Administration," choose "Site libraries and lists."
3. Choose "Customize (library name)." and then "Advanced settings."
3. Under "Opening Documents in the Browser," select "Open in the client application" and click OK.
Hopefully this answers some of the earlier questions as well!
Thanks,
-Chris
I actually installed Sharepoint and a Web App server and it appears PDFs open in adobe reader by default out of the box rather than the Word App. We'd actually prefer to have it in the "Word App" so we can add comments.
However, when I try that last string of yours, I get "Invalid Argument" Parameter Binding Exception. "FullyQualifiedErrorID: PositionalParameterNotFound."
any tips?
Sorry Michael, I can't seem to make it throw that error. Are the Office Web Apps working OK for other types of documents, like .docx and .xlsx? Which protocol are you using, HTTP or HTTPS?
Thanks,
-Chris
It seems WordPdf action is different from other applications (Word, Excel…).
If I enabled OpenInClient feature, PDF attachments may still be opened (left-click) in WopiFrame, others opened in client.
And [save as…] with right-click will use normal link to the attachment file.
If I disabled OpenInClient feature, [save as…] with right-click will use link with WopiFrame.
I can't save correctly.
How can I open all types in WopiFrame by left-click, and save all types correctly by right-click?
Thank you very much.
Hi marksu22, great question! Unfortunately I don't know of a way to configure the right-click > Save target as… action differently from the View action. I agree that it would make more sense to be able to right-click and save the .pdf file as usual, even when WordPDF viewing is enabled. I'll pass that feedback on to the product team and let you know if they have any workarounds for this.
Thank you,
-Chris
Hi again marksu22, you should be able to save the document by using the SharePoint download feature. In the document library, click the ellipsis (…) next to the document title, then click the other ellipsis (…) at the bottom of the document menu, then click Download a copy. Hope this addresses your problem.
Thanks,
-Chris
Thank you Chris.
This download instruction will be added to the Q&A for users for now.
Thanks.
I recently installed office 365 university on my computer, can I open PDF files or do I need another program.
Hi Elmer,
Thanks for your question. In Office 365, PDF files currently do not open in the Word Web App as they do in the on-premises Office Web Apps, so you'll need to install another PDF reader such as the free Adobe Reader.
Hope this helps.
-Chris
Sir,
I have installed wordweb recently . Now when i will be reading a pdf doc or in ms word, when i select a word in it(highlight), when i right click is there any setting to be done so that i gives suggestion to me that lookup in wordweb dictionary, Please let me know.
Thanks Chris for this article. I have issues accessing PDF and Word file in one Web application, the other web application works charm… Any idea or inputs….
Hi! How do you change it so PDFS will open in Word but everything else will open in Adobe?
Hi Chris! For such a long time WordPDF is disabled from O365. I don't care what kind of "issues" some companies experienced, our company needs the preview option badly. WHY is it so difficult to implement an administrative switch to enable/disable PDF
view on a library or site level? Or when are any improvements expected?
We are using IRM and when I use this powershell it breaks security. Our users are tired of downloading to print. Have found any other way to do this?
Thanks a lot
I have tried "Get-SPWOPIBinding –Application "WordPDF" | Remove-SPWOPIBinding -Confirm:$false" and configured the Bibliothek that pdfs should open in Client application, but it doesnt work. PDFs are always opened in my Browser.
What can i do?
Thanks a lot.
Thanks. it helps a lot
But if I remove WordPDF application, wouldn’t that also disable pdf-previews in search and document libraries?
Thank you, the script solved my issue.
how to open PDF on clicking on the icon
Hi Chris, instead of
Get-SPWopiBinding -Action "MobileView" -Application "WordPDF" | Remove-SPWOPIBinding
why not just
Remove-SPWOPIBinding -Application "WordPDF" -Action "Mobile View"
Hi Chris,
I'm in a situation that there are several file types(docx, xls and pdf) in a single document library. I've disable the wordpdf binding as u mentions above and it give me a message "Viewing of .pdf files has been disabled in Microsoft Word Mobile Viewer. Please
get in touch with your helpdesk." in mobile. But I do not want to configure all of the extension to be open in client application. Any other work around as u may recommend ?
Even though i removed the binding Get-SPWopiBinding -Action "MobileView" -Application "WordPDF" | Remove-SPWOPIBinding still pdf files tries to open in office web app and giving the error since i removed. Do i need to do any additional steps after removing
binding.
I ran this command, but after that, any office document gives out a "An error has occurred on the server" error.. could you please help? The PDFs open fine in a client app.