The app I built uses the docx NPM package to dynamically generate Word documents on a Node server. You can catch a peek of the API here, although it may not be very clear which pieces of code are for docx and which pieces of code are for dealing with the Quill delta objects I'm trying to convert.
Just a heads-up: the documents it generates look okay in MS Word, but cause LibreOffice to crash immediately.
Unfortunately there is no official package for doing this, nor is there one with a big open-source community supporting it, nor is the format simple enough that you could trivially hack it together yourself.
Could you get away with an RTF file or a PDF? You may find those less annoying.
Alternately, if you are generating lots of very similar files, there are a few NPM packages that make it really simple to start from a Word template and replace certain tokens (like {myTemplatedString}) with custom data.
If you absolutely, positively have to generate a DOCX file from scratch with custom formatting, then it can be done, but I have to warn you it will be a slow and painful process.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The app I built uses the docx NPM package to dynamically generate Word documents on a Node server. You can catch a peek of the API here, although it may not be very clear which pieces of code are for
docx
and which pieces of code are for dealing with the Quill delta objects I'm trying to convert.Just a heads-up: the documents it generates look okay in MS Word, but cause LibreOffice to crash immediately.
Unfortunately there is no official package for doing this, nor is there one with a big open-source community supporting it, nor is the format simple enough that you could trivially hack it together yourself.
Could you get away with an RTF file or a PDF? You may find those less annoying.
Alternately, if you are generating lots of very similar files, there are a few NPM packages that make it really simple to start from a Word template and replace certain tokens (like
{myTemplatedString}
) with custom data.If you absolutely, positively have to generate a DOCX file from scratch with custom formatting, then it can be done, but I have to warn you it will be a slow and painful process.