Zum Inhalt springen
#0196
Browser

Render a PDF the way the user sees it

Your app emails invoices. Each one needs a PDF attached: same fonts, same logo, same conditional rows the customer sees in the web view. You used to maintain a separate Puppeteer service for this, with its own Dockerfile and its own deploy.

Now you call GET /pdf?url=https://app.example.com/invoice/8821&format=A4 on your container's browser instance. Hoody's Chromium navigates to your real invoice page, authenticated by the cookie you posted earlier, and returns the rendered PDF as binary. Same engine that renders the page in the customer's browser. Same CSS print rules.

No HTML-to-PDF library that drifts from your stylesheet. No headless Chrome you maintain. The thing that already renders your page renders your PDF.

Your invoice generator stopped being a service. It's a URL with a query string.