commonform-docx
v11.2.0
Published
render Common Forms in Office Open XML (Microsoft Word .docx format)
Maintainers
Readme
commonform-docx
render Common Form objects in Office Open XML (Microsoft Word .docx format)
The exported function takes three arguments:
a Common Form
an Array of fill-in-the-blank values
an options Object
The options object must contain:
- a
numberingproperty whose value is an abstract numbering
It may contain:
a
titleproperty whose value is a stringan
versionproperty whose value is a stringa
hashproperty whose value istrueorfalsea
markFilledproperty whose value istrueorfalseother properties you can find in function exported from
index.js
The function returns a JSZip Object primed with .docx document data.
For example:
const zip = docx(form, {
title: 'Example Document',
version: 'Version 1.0.0'
})
await writeFile(
'example.docx',
await zip.generateAsync({ type: 'nodebuffer' })
)