1

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 Answers1

2

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.readthedocs.io/en/latest/faq.html#inserting-new-lines

edi9999
  • 19,701
  • 13
  • 88
  • 127
  • 1
    I can ask you for advice regarding this: https://stackoverflow.com/questions/68002166/react-js-read-the-text-of-a-doc-docx-file – Paul Jun 16 '21 at 13:16