简体   繁体   English

将网页下载为Word文档(docx)

[英]Download webpage as Word document (docx)

I have a wordpress page with some custom features in JS that people can save in a pdf format. 我有一个WordPress页面,其中包含一些JS中的自定义功能,人们可以将其保存为pdf格式。 Is there a way to allow people to download the page in docx (MS Word) as well? 有没有一种方法可以让人们以docx(MS Word)下载页面? I tried searching for a solution but couldn't find much. 我尝试寻找解决方案,但找不到很多。

I'd like to have a button 'Download as docx' that generates a similar looking version as the pdf format. 我想要一个按钮“下载为docx”,该按钮生成的外观与pdf格式相似。

Ideally, I'd like to do it in JS or find a WP plugin that offers the functionality. 理想情况下,我想在JS中进行操作,或者找到提供该功能的WP插件。

Thanks for the help 谢谢您的帮助

Thomas 汤玛士

You can do this with JavaScript. 您可以使用JavaScript执行此操作。 There's a repository for it on Github html-docx-js . 在Github上有一个存储库html-docx-js There's also a jquery plugin googoose . 还有一个jquery插件googoose

You can also do it with a WP plugin that uses googoose. 您也可以使用使用googoose的WP插件来做到这一点。

There is also this plugin , FileSaver.js. 还有一个插件 FileSaver.js。 You are able to export to .doc using jQuery 您可以使用jQuery导出到.doc

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM