node-red-contrib-docxtemplater
Version:
Generate docx, pptx, and xlsx from templates (Word, Powerpoint and Excel documents), from Node-Red
43 lines (36 loc) • 1.71 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('docxtemplater', {
category: 'function',
color: '#a6bbcf',
defaults: {
name: { value: "" },
templateDocx: { value: "" },
outFile: { value: "" }
},
inputs: 1,
outputs: 1,
icon: "font-awesome/fa-file-word-o",
label: function () {
return this.name || "docxtemplater";
}
});
</script>
<script type="text/html" data-template-name="docxtemplater">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-output"><i class="fa fa-print"></i> Template(Docx)</label>
<input type="text" id="node-input-templateDocx" placeholder="TemplateDocx" />
<label for="node-input-output"><i class="fa fa-file"></i> Outfile</label>
<input type="text" id="node-input-outFile" placeholder="Outfile" />
</div>
</script>
<script type="text/markdow" data-help-name="docxtemplater">
Docxtemplater node generates a new Word document by filling the template created in Word with metadata from `msg.payload`.
The metadata is taken from the `msg.payload` object.
The path to the Word template can be provided by filling the Template(Docx) field within the node or by using `msg.templateDocx`.
If no path is provided for the Word file generated with metadata, the node will output it as a buffer.
If the output is desired as a file rather than a buffer, the `Outfile` field on the node or `msg.outFile` should be filled.
</script>