Comparison

Generate PDFs without operating a browser fleet

Puppeteer is a well-maintained library and its PDFs look right. What it hands you is a browser fleet to operate: memory to provision, queues to build, crashes to recover. KimiDoc gives you the same Chromium-class rendering behind a metered REST API, hosted or on your own servers. The same trade applies to Playwright's PDF support.

Start free Browse the templates

What running Puppeteer in production actually involves

These are the figures the Puppeteer community itself documents, not a competitor's caricature.

Memory per instance

A Chromium instance wants roughly 200 to 500 MB; heavy documents with images and fonts push past that, and concurrent renders multiply it. Out-of-memory crashes are the classic failure.

Cold starts and lifecycle

Launching Chromium takes several hundred milliseconds before rendering begins, and something must manage launch, reuse, zombie processes and restarts, especially on serverless.

The harness is yours to build

Queueing, per-document retry, timeout handling, monitoring and horizontal scaling are not in the library; every team reimplements them around it.

Side by side

KimiDocpuppeteer
RenderingChromium-class print engineHeadless Chromium
Output fidelityEquivalent: modern CSS, fonts, SVG, JSEquivalent: modern CSS, fonts, SVG, JS
What you operateAn API keyBrowser fleet, queues, monitoring
ConcurrencyPooled and queued server-sideProvision and orchestrate yourself
Cold startsNone: the render pool is pre-warmedSeveral hundred ms per launch, unless you build instance reuse
Batch of 40,000 documentsOne request, one ZIP, per-document retryA loop, plus everything that can fail inside it
TemplatesStored server-side with sample data and a live editorString-building or a template library in your code
Encryption, watermarks, appending PDFsBuilt inAdditional libraries and glue
Failure handlingPer-document status; failed documents retry without redoing the runCrash recovery is your code
Cost modelDocuments rendered; failures are never countedInfrastructure, plus the engineering time

When Puppeteer is the right choice

If you already run Puppeteer or Playwright for testing or scraping and PDFs are an occasional side output, adding a service is overhead. The same goes for low-volume internal tools, for screenshot generation, and for teams with a strict no-external-dependency policy and the engineering time to honour it. The calculus flips when document volume becomes a product feature rather than a byproduct.

Migrating from page.pdf()

  1. Map the options. format becomes pageSize, margin becomes marginsMm, landscape stays landscape. Backgrounds always render.
  2. Move headerTemplate and footerTemplate into CSS. @page margin boxes with counter(page) / counter(pages) replace them, inside the document itself.
  3. Replace waitUntil with an explicit signal. Call window.pdfReady() when your charts or fonts are done and render with waitForReady: deterministic, instead of network heuristics.
  4. Move templating server-side. Store the template once with {{placeholders}} and sample data; requests then carry only data. Batches become one job submission instead of a loop.

Questions engineers ask

Is Puppeteer bad at generating PDFs?

No. The output is fine; Puppeteer and Playwright are actively maintained. The comparison is operational: with a library you run the browsers, with KimiDoc you call an API and the pool, queue and retries are already there.

Does this apply to Playwright too?

Yes. Playwright's PDF support drives the same headless Chromium, so the memory, lifecycle and harness considerations are identical.

Can we still keep rendering on our own infrastructure?

Yes. KimiDoc self-hosted runs the same engine inside your network under a per-server licence; your data never leaves. The hosted API is the zero-ops option.

How do we try it against our real documents?

Paste a template into the editor on the free tier: previews are unmetered, and the free tier renders 100 documents a month through the API.

Try it against a real document

The editor previews are free and unmetered; the free tier renders 100 documents a month through the API.

Start free Ask about self-hosting