4 ms·
The consolation is that, if I remember correctly, docx is just a zip file containing xml. I made an xlsx exporter in actionscript3 (lol) years ago and it worke
by MrLeap 4y ago
The consolation is that, if I remember correctly, docx is just a zip file containing xml.
I made an xlsx exporter in actionscript3 (lol) years ago and it worked like this. What I ultimately did was made a "template" document, and my code just injected strings into key spots, zipped it up in memory and gave it to you as a file.xlsx. Probably took me 3 days?
I didn't have the benefit of libraries so I imagine this is significantly easier in less hobbled environments, nodejs or whatever probably has a kitchen sink package to do it.
- lofatdairy 4y agoThat's exactly right. There are definitely nodejs docx templating packages (I've worked on codebases that used them in the past), but they're certainly not required provided your documents are reasonably simple. If anything, generating a pdf from various input files/structured text has been a much harder task. We generated docx files to allow for easy modification by non-technical staff, but to generate a pdf we had to use a headless instance of libreoffice since pandoc was struggling with the rendering.