docxtemplater
Advanced tools
Changelog
3.47.3
Improve getStructuredTags and getTags of the inspectModule to allow to get tags present in image attributes.
(This is to work together with the image-module 3.28.0)
Changelog
3.47.2
Bugfix internal api mechanism :
It internally allows to have multiple traits.expandToOne().
Fixes bugs with the subtemplate and subsection module.
Update moduleApiVersion to 3.40.0.
Changelog
3.47.1
If zip file is not a docx file, show the following error message now :
The filetype for this file could not be identified, is this file corrupted ? Zip file contains : world.txt,xxx.log
In previous versions, the following message was shown :
The filetype for this file could not be identified, is this file corrupted ?
Changelog
3.47.0
Make it possible to dynamically allow to use a given tag for a module.
For example, you can write :
const doc = new Docxtemplater(zip, {
modules: [
{
optionsTransformer(options, doc) {
doc.modules.forEach(function (module) {
if (module.name === "RawXmlModule") {
module.prefix = function (placeholderContent) {
if (placeholderContent === "raw") {
return "raw";
}
if (placeholderContent[0] === "@") {
return placeholderContent.substr(1);
}
};
}
});
return options;
},
},
],
});
This code means that if you write : {raw} in your document (without the "@" prefix), that tag will be used as a rawxml tag.
Changelog
3.46.2
Add "synced-zip" event that is run right after the zip is prepared.
Update moduleApiVersion to version 3.39.0, which is used by the latest subtemplate module.
Changelog
3.46.0
When using a loop inside a powerpoint table, if the result is an empty table, correctly drop the table from the presentation.
Changelog
3.45.1
Add getObjectIdentifiers to expressionParser, which can be used like this :
const expressionParser = require("docxtemplater/expressions.js");
expressionParser("a.b.c").getObjectIdentifiers();
// returns { a: { b: { c: {} } } }
Changelog
3.45.0
Bugfix for proofstate module : Following error was thrown when using this module :
Unnamed module
Now the module should work correctly
Changelog
3.44.0
Make it possible to configure the angular parser for just one docxtemplater instance.
(This needs angular-expressions version 1.2.0)
Use following code :
const expressionParser = require("docxtemplater/expressions.js");
new Docxtemplater(zip, {
parser: expressionParser.configure({
csp: true, // this disables the use of "new Function", useful for Vercel, Deno, ...
filters: {
uppercase: (input) => {
if (typeof input === "string") {
return input.toUpperCase();
}
return input;
},
},
}),
});