DEV Community
•
2026-03-19 20:29
Stop Fighting with PDF Libraries: Generate Dynamic PDFs Using HTML & JSON
Generating PDFs in a web application is a task that almost every developer dreads. Whether it’s an invoice, a shipping label, or an event ticket, we usually find ourselves stuck between two extremes:
Old-school libraries (mPDF, iText, etc.): These often feel like coding in the 90s. No Flexbox, no Grid, and very limited CSS support.
Headless Browsers (Puppeteer/Playwright): They work great, but...