In Node.js, I'm able to write metadata in pdf file using hummus npm, but I also need to write metadata to docx file.
Please let me know if someone has suggestions for this.
A Docx file comprises of a collection of XML files that are contained inside a ZIP archive. The contents of a new Word document can be viewed by unzipping its contents.
you can use unzipper npm to unzip docx file.
fs.createReadStream('path/to/archive.zip')
.pipe(unzipper.Extract({ path: 'output/path' }));
2. Once unzip the docx file, you can see app.xml and core.xml files in docProps directory, and update this as you require for the metadata of the docx file.
./docProps/
./word/
./_rels/
./customXml/
./[Content_Types].xml
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