I have successfully done code to display a PDF file in HTML using angular instead of the "Open/Save" dialog. Now, I'm stuck trying to display a Word document. I used to display a Word document and done successfully but i want to restrict the file to be opened in new tab so that he can't download
Unlike PDF, Word documents can't be opened directly in the browser, but if you want to display a word document in a web page and secure it (prevent users from downloading it) you can use Either Google Docs/Office 360 Viewer
Embed them a new page and write some JS to further secure it by disabling copy/paste & right-click (but please note that this JS might get disabled) using Iframe like this
<iframe src="https://docs.google.com/gview?url=http://ieee802.org/secmail/docIZSEwEqHFr.doc&embedded=true" frameborder="0">
</iframe>
Examples:
Google Docs Viewer
Microsoft Office Viewer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With