简体   繁体   English

如何使用angular在HTML中呈现Word文档(.doc,.docx)

[英]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: 例子:

Google Docs Viewer Google文件检视器

Microsoft Office Viewer Microsoft Office查看器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 JavaScript 在浏览器中呈现 Word 文档(.doc、.docx)? - How do I render a Word document (.doc, .docx) in the browser using JavaScript? 如何使用 docx 从 angular 将图像添加到 Word 文档? - How to add images to a Word document from angular using docx? 如何使用 JavaScript 创建 a.docx 文件而不是 a.doc 单词 - How to create a .docx file and not a .doc word using JavaScript 如何使用docx4js读取Word文档的页眉或页脚? - How do I read the header or footer of a Word document with docx4js? 如何使用Bootstrap和Java脚本渲染Word文档 - How can I render word document using Bootstrap and Java Script 使用 Node 的 'Docx' 到 append 到带有 JS 的现有 Word 文档 - Using Node's 'Docx' to append to an existing Word doc with JS 如何使用角度渲染特定数据? - How do I render specific data using angular? 如何使用docx4j阅读word文档并使用所有样式获取部分文档 - How to read word document and get parts of it with all styles using docx4j 在 html 中嵌入 .doc/.docx/.odf/.pdf/.ppt/.pptx 文件并呈现它们 - Embed a .doc/.docx/.odf/.pdf/.ppt/.pptx file in html and render them 在html文档中使用表单时,如何在同一页面中显示数据? - How do i display data in the same page while using a form in a html doc?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM