How to use the docxtemplater.Docxtemplater function in docxtemplater

To help you get started, we’ve selected a few docxtemplater examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github owtf / owtf / owtf / webui / src / Report / Export.js View on Github external
function getDocxReportFromJSON(json, template) {
    let zip = new JSZip(templates[template]);
    let doc = new Docxtemplater();
    doc.loadZip(zip);

    //set the templateVariables
    doc.setData(json);

    try {
        // render the document (replace all occurences of tags.
        doc.render()
    } catch (error) {
        let e = {
            message: error.message,
            name: error.name,
            stack: error.stack,
            properties: error.properties
        }
        console.log(JSON.stringify({

docxtemplater

Generate docx, pptx, and xlsx from templates (Word, Powerpoint and Excel documents), from Node.js, the Browser and the command line

MIT
Latest version published 10 days ago

Package Health Score

84 / 100
Full package analysis