nodejs npm 库来访问和修改 Microsoft Word 文档 [英] nodejs npm libraries to access and modify microsoft word documents

查看:74
本文介绍了nodejs npm 库来访问和修改 Microsoft Word 文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您知道是否可以在网站上托管的 Microsoft Word 文件(.doc 或 .docx)中搜索诸如xAx"之类的特定文本,将其替换为用户输入的其他一些文本并使该文件可用使用nodejs下载?

Do you know if it is possible to search specific text like "xAx" into a Microsoft Word file (.doc or .docx) hosted on a website, replace it with some other text input by the user and make the file available for download using nodejs?

有可以做到这一点的 npm 库吗?

Is there a npm library that can do that?

如果不是,是否可以操作 PDF 文件?请注意,我不想创建文档,而是在服务器中操作模板文件.

If not it is possible to manipulate a PDF file instead? Please note that I do not want to create the document but manipulate a template file in the server.

感谢您的帮助.

推荐答案

有项目https://github.com/open-xml-templating/docxtemplater 用于替换 .docx 文件中的 {placeholders}.

There is project https://github.com/open-xml-templating/docxtemplater which serves for replacing {placeholders} in a .docx files.

还支持循环和图像,请查看 http://javascript-ninja 上的演示(示例).fr/docxtemplater/v1/examples/demo.html

Also supports loops and images, check out demo (examples) on http://javascript-ninja.fr/docxtemplater/v1/examples/demo.html

这篇关于nodejs npm 库来访问和修改 Microsoft Word 文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆