|
|
|
|
|
by Leoko
832 days ago
|
|
I had to deal a lot with PDF generation over the past few years and I was very unhappy with the eco-system that was available: 1. HTML-to-PDF: The web has a great layout system that works well for dynamic content. So using that seems like a good idea. BUT it is not very efficient as a lot of these libraries simply spin up a headless browser or deal with virtual doms. 2. PDF Libraries (like jsPDF): They mostly just have methods like ".text(x, y, string) which is an absolute pain to work with when building dynamic content or creating complex layouts. This was such a pain point in various projects I worked on that I built my own library that has a component system to build dynamic layouts (like tables over multiple pages) and then computes that down to simple jsPDF commands. Giving you the best of both worlds. Hope this makes somebody's life a bit easier: https://github.com/DevLeoko/painless-pdf |
|
https://weasyprint.org
Going all the way down to raw HTML is a bit verbose, but with almost anything I've thrown at it - CV's, business cards, you name it - it hasn't let me down yet.