[英]How do I render a Word document (.doc, .docx) in the HTML using angular
I have successfully done code to display a PDF file in HTML using angular instead of the "Open/Save" dialog. 我已经成功地完成了使用角度(而不是“打开/保存”对话框)以HTML格式显示PDF文件的代码。 Now, I'm stuck trying to display a Word document.
现在,我被困在尝试显示Word文档。 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
我曾经显示过Word文档并成功完成,但是我想限制在新标签页中打开文件,以便他无法下载
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 与PDF不同,Word文档无法在浏览器中直接打开,但是如果您要在网页中显示Word文档并保护它(防止用户下载),则可以使用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 将其嵌入新页面并编写一些JS,以通过使用Iframe这样禁用复制/粘贴和右键单击(但请注意,此JS可能会被禁用)来进一步保护其安全
<iframe src="https://docs.google.com/gview?url=http://ieee802.org/secmail/docIZSEwEqHFr.doc&embedded=true" frameborder="0">
</iframe>
Examples: 例子:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.