How to put linebreak after text with docxtemplater

991 views Asked by At

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?

1

There are 1 answers

1
edi9999 On BEST ANSWER

I'm the creator of docxtemplater.

You can use the following code :

const doc = new Docxtemplater(zip, {linebreaks: true});

By default, docxtemplater does'nt take into account linebreaks, but with this option it will add them.

https://docxtemplater.com/docs/faq/#inserting-new-lines