create personalized docx from docx template and data
*plain text form control's tag with pattern ${...} *plain text form control's content with pattern ${...}
picture form control's tag with expression pattern ${...}
richtext form control's tag with pattern if(...)[with][{...}]
richtext form control's tag with pattern for(;;)[with][{...}]
- dynamic: richtext form control's tag with pattern include(exp:subdoc url)
- embed: richtext form control's tag with pattern include(), and content is embeded word ole object
richtext form control's tag with pattern script(...), and content is embeded javascript ole object
return Promise, resolved with a VariantDocx with following api * assemble({}/data/, {clearWrap=true/default clear sdt/}/option/): return Promise resolved docx4js instance
import docxTemplate from "docx-template" docxTemplate.parse("~/template.docx").then(varDoc=>{ let staticDocx=varDoc.assemble({name:"foo"}) staticDocx.save("~/static.docx") })
- support javascript file for functions
- inline subdoc
GPL