There is a file in almost every backend I have worked on. It generates PDFs. Invoices, mostly. Sometimes reports or certificates. It was written years ago by someone who left, it runs a headless browser nobody fully understands, and it falls over on the last day of the month when finance needs the invoices out.

I have rebuilt this same haunted corner enough times that I decided to fix it once, properly, for everyone. It is called PDFPipe.

The actual problem

Generating a PDF from HTML sounds trivial until you run it in production at any scale. The usual path is a headless Chromium (Puppeteer, Playwright, wkhtmltopdf, or Gotenberg). Then you discover:

Chromium wants 0.5 to 1 GB of RAM per instance and falls over under load.