首页 > 解决方案 > How do I get docx.js children method to work?

问题描述

I would like to create a web app to generate .docx files.

So I found docx.js. I got a basic file to generate. With the use of constants, it's not much of a problem.

However, when using the children method, it only generates an empty .docx.

doc.addSection({
    children: [
        new Paragraph({
            children: [new TextRun("Hello World")],
        }),
    ],
});

https://codepen.io/DVGeoffrey/pen/ExxgEJv here is the pen.

What am I doing wrong here? How do I get this to work properly? Thank you :-)

标签: javascript

解决方案


推荐阅读