I'm using the Microsoft Online Viewer ( http://products.office.com/en-us/office-online/view-office-documents-online ) to show documents inside my asp.net mvc website (in iframe). It allows to view word, excel and power point documents.
I've used a div over the viewer controls to disable users from clicking "save" and "print" options.
The problem is when users press "Ctrl+P" inside the iframe it allow users to print the document.
Does anyone knows how to disable printing using the Microsoft Viewer?
Some options I've tryed:
- Accessing the iframe using Javascript and disable printing - I can't do that because the source of the iframe is from another domain and it generates the cross-origin exception.
- Showing a transparent div over the viewer, so users couldn't click the iframe to press "Ctrl+P" - if users click the scrollbar then it focus the iframe and allow printing.
Is there any way to use this viewer or the onedrive viewer, disabling the print option?
Thank you.
-- edited --
I've found there's a parameter named wdPrint to disable printing. When I'm sharing the document it uses this parameter. I set wdPrint=0, but it's not working. I also couldn't disable the "Download" option on the context menu.
Here's my link: https://view.officeapps.live.com/op/embed.aspx?wdPrint=0&src=http%3A%2F%2Fmds.prodater.teresina.pi.gov.br%2Fdocs%2FModelo%2520Ata%2520Reuniao.docx
Thank you.