Menu

Generating PDF invoices without running Puppeteer in production
📰

Generating PDF invoices without running Puppeteer in production

DEV Community: node·PDFglyph·11 days ago
#vARSZvVw
#devtonodejs#devto#dev#html#chrome
Long article (815 words) — no AI summary yet.
Reading 0:00
15s threshold

PDFglyph

Posted on Nov 25

Edited on Nov 25

Every side project that needs a PDF ends up in the same place. You search "generate PDF from HTML node", the first answer is Puppeteer, and twenty minutes later you have an invoice coming out of headless Chrome on your laptop. It looks great. You ship it.

Then production happens.

What headless Chrome costs you in production

The Docker image ; chromium needs a pile of shared libraries that slim Node images don't ship. You either switch to a fat base image or copy a list of apt packages from an old blog post and hope. My image grew by about 400 MB either way.

The sandbox flags : every example tells you to launch with --no-sandbox . Most of us paste it without reading it. That flag disables Chrome's process isolation, on a process that renders arbitrary HTML, inside your network.

Memory : each page is a real browser tab. A handful of concurrent renders and a small VPS starts swapping.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.