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 string -
an
versionproperty whose value is a string -
a
hashproperty whose value istrueorfalse -
a
markFilledproperty whose value istrueorfalse -
other 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' })
)