Has anyone tried ApyHub yet ? There's a ton on API available there and more seems to be coming on the way.
I used phpdocx.com about 8 years ago and it served the purpose really well. It's in PHP (7, 8) and they support a wide range of features of converting HTML to DOCX (and also to PDF). I didn't use the HTML to PDF conversion as mPDF does that well enough. But the to DOCX conversion is neat and pretty quick. But pricing of PHPDOCX makes sense only if your revenue is at a much higher level and not for startups esp if not funded.
Arrives ApyHub ! They claim to be "Introducing a New Era of Simplified APIs"
ApyHub’s HTML to DOCX is a direct drop in replacement for PHPDOCX (which was costing close to a thousand dollars). And an update to the next version would result in an upgrade price. On the other hand, an external API to perform document conversions eliminates the need to setup a software and run it locally or our server. At $10 a month subscription was a boon to reduce complexities and allows developers to focus on the core application development. And at $10 a month, you can perform 5M atoms / month and HTML to DOCX costs 120 atoms - so that's 41,666 conversions in a month. Pretty neat if you're not using any other API services which would cost atoms.
This would not seem feasible if the data you want converted should not be sent to an external service for privacy of data.