@eko many of those applications you are talking about will work fine with English and latin text but will fall apart the moment you use Arabic (right-to-left or bidirectional text) or some other non-latin script (e.g. Chinese, Japanese, Korean etc)
There is no PDF library that can do it all correctly. From my past testing, the best one is PrinceXML and can handle almost everything I throw at it but they do not sell royality free license. And the price is $495 per computer. Just not viable.
I found web-browsers to be the only layout engine able to produce good enough PDF using any UTF-8 characters. And unlike PrinceXML, web-browsers are free. But web-browsers do not support printing to PDF via javascript.
So the only solution would be to ship entire web-browser with all the fonts… and now Manager is not 100MB download. It’s at least 1GB download. Bundling the entire web-browser with Manager installation would also become a lot more complex and more brittle.
Another alternative is for Manager to use local Google Chrome installation in headless mode. Although it forces user to install Google Chrome, it works reasonably well on the desktop. But it’s such a pain on the server because headless servers do not have Google Chrome and to install it comes with a lot of dependencies that are typically not deployed on servers. Just again overcomplicating things.
So in the end, I didn’t discover a way to do it without getting into too much complexity. And haven’t seen anyone else to discover it. My focus is on making good accounting software. Emailing documents as PDF files is not core competency of Manager. In the future, there will be eventually simple way to do it, or people will move away from PDFs. I mean the idea of PDFs is to have a digital format that can be printed reliably on physical media (paper). People tend print less than before so we might not need PDF in long-term.