PDFPipe

Puppeteer PDF alternative

A Puppeteer PDF alternative that survives production

Puppeteer renders beautiful PDFs on your laptop and then fights you in production: chromium that will not fit in a function, cold starts, timeouts under load, crashes, and a slow memory leak. Keep the Chromium-quality output, drop the operations, by calling a render API instead.

The Puppeteer pain you already know

Memory leak

Long-running workers creep upward until the process is OOM-killed. Recycling browsers becomes its own subsystem.

Timeouts and crashes

Under concurrency, page.pdf hangs or the browser tab crashes, and a swallowed error leaves a zombie process holding memory.

Chromium will not fit

Serverless functions cannot ship a full Chromium binary, so you fight @sparticuz/chromium layers and cold starts.

Before and after

The before is a browser you launch, drive, and must tear down perfectly every time. The after is a single request.

JavaScript
// The setup that pages you at 2am
import puppeteer from "puppeteer";
const browser = await puppeteer.launch();      // cold start, memory, crashes
const page = await browser.newPage();
await page.setContent(html);
const pdf = await page.pdf({ format: "A4" });  // timeouts under load
await browser.close();                          // leaks if it throws above

Same output, none of the operations

JavaScript
// The replacement: one HTTP call, nothing to operate
const res = await fetch("https://api.pdfpipe.xyz/v1/pdf", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PDFPIPE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ html, options: { format: "A4" } }),
});
const pdf = Buffer.from(await res.arrayBuffer());

What you stop owning

  • No browser pool, no per-worker recycling, no OOM babysitting.
  • No cold starts from launching Chromium on the request path.
  • No concurrency limiter to hand-tune so renders stop crashing.
  • Rendering scales independently of your app and bills per document.

Frequently asked

Why does Puppeteer PDF crash in production?

Usually concurrency and memory. Each browser is heavy, launches are slow, and a failed render can orphan a process. Without strict pooling, recycling, and concurrency limits, workers leak memory and eventually crash. Moving rendering to an API removes that operational burden.

How do I fix a Puppeteer PDF memory leak?

Recycle browsers after N renders, always close pages and browsers in finally, and cap concurrency. The simpler fix is to not run the browser at all and call a rendering API, which handles isolation and recycling for you.

Is the output the same quality as Puppeteer?

Yes. The API renders with a modern browser engine, so fonts, CSS, and page breaks match what Puppeteer produces, without you operating a browser.

Does this work as puppeteer as a service?

That is exactly the model: browser-grade PDF rendering delivered over HTTP, so you get Puppeteer-quality results without provisioning or scaling browsers.

Related reading

These pages cover related search intents. Pick the one that matches what you are building.

500 free documents a month, flat pricing after that, and a live playground you can try without signing up.