Demo
Readme
Changelog
Releases RSS Feed
Compatibility : nodejs and browser

Summary (version 3.0.1) Buy meta module

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.

README

Meta Module

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

The META 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.readonly();
doc.render();
const buffer = doc.getZip().generate({ type: "nodebuffer"});

After installing the module, you can use a working demo by running node sample.js.

CHANGELOG

3.0.1

  • Move docxtemplater from devDependencies to dependencies

Explanation : On some versions of npm (notably 5.8.0), when having a package containing docxtemplater-meta-module, the installation will generate a tree of node_modules that puts the module on a level where it has no access to docxtemplater. By explicitly asking it as a dependency, this issue is avoided.

3.0.0

Initial release

Edgar Hipp

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