Ask HN: What is nowadays (opensource) way of converting HTML to PDF?
1•hhthrowaway1230•1h ago
I'm using wkhtmltopdf but it is painful to work with? what are other people using nowadays? i.e canva or other tools?
Comments
zja•1h ago
pandoc
hhthrowaway1230•1h ago
doesn't pandoc rely on some engine itself?
throw03172019•1h ago
I run chromium on my server and render the PDF from there using puppeteer.
kappadi3•1h ago
Puppeteer and Playwright are the main open-source options nowadays, both solid for HTML → PDF once your print CSS is sorted.
Don’t forget proper page breaks (break-before/after/inside) — e.g. break-after: page works in Chromium, while always doesn’t. For trickier pagination you can look at Paged.js, and I’d test layouts in Chrome/Edge before automating.
zja•1h ago
hhthrowaway1230•1h ago