sundowatch
sundowatch

Reputation: 3093

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?

Upvotes: 1

Views: 1267

Answers (1)

edi9999
edi9999

Reputation: 20544

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

Upvotes: 2

Related Questions