Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
/ kth-node-docx Public archive

A docx export module for Node.js applications.

License

Notifications You must be signed in to change notification settings

KTH/kth-node-docx

Repository files navigation

⚠️ Archived at 2023-09-12, since none of our apps is currently using it. ⚠️

docx generator

Given a docx file with the following content:

{@publications}

And an XML string generated with the template and/or docx helpers:

<w:p><w:r><w:t>hello world</w:t></w:r></w:p>

Code usage

var fs = require('fs')
var docx = require('@kth/kth-node-docx')
var xml = '<w:p><w:r><w:t>hello world</w:t></w:r></w:p>'
var templateBuffer = fs.readFileSync('template.docx', 'binary')
var outputBuffer = docx.generate(xml, templateBuffer, 'publications')
fs.writeFileSync('publications.docx', outputBuffer)

For an example of how to use the XML helpers, see the test/integration.js file.

About

A docx export module for Node.js applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •