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