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?
Is there a npm library that can do that?
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.
Thank you for your help.
Method 1.Select the file that gives you the error “Cannot open Word document: access denied” and right-click on it. From the list, select Properties. Then click on Security, then click on the Advanced or Edit tab. Then click Add, then Add Permissions, then Select a Principal, then Advanced.
There is project https://github.com/open-xml-templating/docxtemplater which serves for replacing {placeholders} in a .docx files.
Also supports loops and images, check out demo (examples) on http://javascript-ninja.fr/docxtemplater/v1/examples/demo.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With