Questions tagged [docxtemplater]

docxtemplater is a Javascript software library that allows to do some templating on the docx and pptx format. https://github.com/open-xml-templating/docxtemplater

docxtemplater can be used to replace placeholders in a word document.

With following document :

Hello {name} !

and following data as JSON :

{ "name" : "John" }

After templating, the document will contain :

Hello John

docxtemplater supports simple replacing, but also loops, conditions and raw xml insertion

56 questions
1
vote
0 answers

Docxtemplater angular-expressions not working for nested objects

I'm trying to generate a .docx file with docxtemplater in nodejs. I am also using the angular-expressions library as per their instructions in the docs. The issue is that everytime I try to access a nested object's field, I get undefined in the…
Gabriel
  • 23
  • 2
1
vote
0 answers

Text is not converting to Bold or Red when downloading Doc using Docxtemplater

I'm using Docxtemplater(v^3.9.1) and jszip(v^)2.6.1 packages to set the data and download template. Below is the content in my issue_uncovered5.docx template. These the requests made when I click on the download…
Ramz
  • 33
  • 5
1
vote
1 answer

DocXtemplater multiple tags on a single line behavior

I am replacing an old program for template-merging with docxtemplater and am trying to recreate the old programs prefix functionality. I want the line removed if all prefixed tags ({$tag}) on that line are undefined. The issue being that if all the…
1
vote
0 answers

How to convert a generated word document DOCX using Docxtemplater to PDF?

i created page to generate documents in word DOCX and I try to generate word document using this code: function loadFile(url,callback){ PizZipUtils.getBinaryContent(url,callback); } function gen(id, dane) { …
miko
  • 11
  • 2
1
vote
1 answer

How to build a list in a word file with docxtemplater?

My template file (i.e. template.docx) is shown as the following: My node.js code: let Docxtemplater = require('docxtemplater'); let fs = require('fs'); let path = require('path'); let PizZip = require('pizzip'); let content =…
The KNVB
  • 3,588
  • 3
  • 29
  • 54
1
vote
1 answer

How to get an docx file generated in node saved to firebase storage

Hi I am quite new to docxtemplater but I absolutely love how it works. Right now I seem to be able to generate a new docx document as follows: const functions = require('firebase-functions'); const admin = require('firebase-admin'); const {Storage}…
1
vote
2 answers

How to render docxtemplater multiple times with different data sets

I use docxtemplater to replace tags in Word documents (which I load from the cloud) with actual values. The Word documents I work with contain arbitrary tags, so I first need to inspect a Word document and get a list of all tags it contains. For…
Mario Varchmin
  • 3,704
  • 4
  • 18
  • 33
1
vote
1 answer

How to load docx files on firebase storage and then save to firebase storage nodejs

I am working with docxtemplater with nodejs and have read the documentation from the link below: https://docxtemplater.readthedocs.io/en/latest/generate.html#node Unlike with the provided documentation, I am trying to load a document from my…
1
vote
1 answer

How to remove spaces between a string in Docxtemplater?

{#form}{importantFacts}{/form} The problem is that the string takes over the whole line For example : 1. This is test 2. This is a longer …
Phil
  • 435
  • 2
  • 9
  • 28
1
vote
1 answer

How to put linebreak after text with docxtemplater

I'm using the docxtemplater module to fill template on a MS Word document. I've used this, but it just add space to the template: var EOL = "\n"; var willBeTemplated = "Something" + EOL; How can I put a line break after this text?
sundowatch
  • 3,012
  • 3
  • 38
  • 66
1
vote
0 answers

Docxtemplater - Newlines between loop iterations

TLDR - how do I use either a custom parser function or modify the loop module to it'll add a newline after each iteration? Long story: I'm using old templates that used to be rendered with some MS tools, now trying to render them with docxtemplater.…
shaharsol
  • 991
  • 2
  • 10
  • 31
1
vote
2 answers

Remove empty line in DocxTemplater

I am getting stated using DocxTemplater with Node. I am trying to figure out how to remove an empty line if the element is empty (i.e '' or null) - I can't seem to find a similar case on SO or elsewhere! My Placeholders on the Docx look like…
tbowden
  • 1,008
  • 1
  • 19
  • 44
1
vote
3 answers

Configuration of the javascript library docxtemplater in XPages

I'm trying to use the library docxtemplater in an XPages application. Javascript library docxtemplater (https://docxtemplater.com/) use as a dependency another library opensource jszip-utils.js (http://stuk.github.io/jszip/) to zip and unzip the…
1
vote
0 answers

Update TOC (table of contents) in .docx using nodeJs and docxtemplater

Microsoft Word tool has default privacy settings with disabled macros and Trusted VB scripts set unchecked. So, writing Macros(VB script) to update fields is not a good idea in order to tell users to allow Macros attached to the document file by…
Shashank
  • 56
  • 8
0
votes
0 answers

Is there a way to convert docxtemplater generated docx file to PDF format?

I have this code in node JS to generate a docx file using docxtemplater, now I need a library to convert the generated docx to pdf, and I need a library that does the PDF rendering better I have tried docx-pdf, LibreOffice-convert, and None of these…