Demo Readme Changelog Buy meta module

Summary (version 3.0.0)

This module makes it possible to operate on the docx document, for example set the document as readonly

This module is available as part of the docxtemplater ENTREPRISE plan.

Demo

Input Output
Data Code
{
    "empty": ""
}
const doc = new Docxtemplater();
const inputZip = new JSZip(docX);
doc.loadZip(inputZip)
	.setData(data);
const metaModule = new MetaModule({});
doc.attachModule(metaModule);
doc.compile();
metaModule.makeReadOnly();
const output = doc.render().getZip();

README

Meta Module

This module doesn't expose tags, but it makes it possible to do some operations on the docx itself.

The HTML module currently can :

  • Make a document readonly

Installation:

You will need docxtemplater v3: npm install docxtemplater

Install this module with npm install --save "$url"

Usage

To use this module, do :

const DocxtemplaterMetaModule = require('docxtemplater-meta-module');
const metaModule = new DocxtemplaterMetaModule();
doc.attachModule(metaModule);
doc.setData(data);
doc.compile();
metaModule.makeReadOnly();
doc.render();
const buffer = doc.getZip().generate({ type: "nodebuffer"});

Building

You can build the es6 into js by running npm run compile

Testing

You can test the module with npm test

CHANGELOG

3.0.0

Initial release

Edgar Hipp

I'm the creator of docxtemplater. I work on making docxtemplater great since 2013.