3 ways to generate PDFs in Node.js (and when to use each)
Puppeteer/Playwright, pdfkit/pdf-lib, or a hosted PDF API — a practical comparison of fidelity, ops burden, and serverless pain for generating PDFs from Node.js.
Read →Practical guides on generating PDFs from code and AI agents — serverless Chromium, HTML-to-PDF, document automation, and the MCP wedge.
Puppeteer/Playwright, pdfkit/pdf-lib, or a hosted PDF API — a practical comparison of fidelity, ops burden, and serverless pain for generating PDFs from Node.js.
Read →Running headless Chromium in a serverless function fails in ways that are hard to debug: bundle-size limits, cold starts, missing system libraries, and timeouts. Here's why, and the simplest way around it.
Read →A worked comparison of per-page and per-document PDF API pricing, with the exact page-count crossover where one model beats the other.
Read →Give any MCP-compatible agent a generate_pdf tool in one line, npx @docweave/mcp, and see why that beats wiring up raw HTTP calls for PDF generation.
Read →An honest comparison of self-hosting Puppeteer or Playwright versus calling a hosted PDF API — same rendering engine, very different operational cost.
Read →A step-by-step guide to building an HTML invoice template with placeholders, sending it template + JSON to Docweave's PDF API, and avoiding duplicate invoices with idempotency keys.
Read →How Docweave's idempotencyKey stops retries and webhook re-deliveries from generating duplicate PDFs or charging you twice for the same document.
Read →A practical guide to CSS @page rules, break-inside, and header/footer templates for clean, correctly-paginated PDFs from Chromium.
Read →A tool-by-tool guide to generating PDFs from Zapier, Make, and n8n using the same underlying HTTP request to Docweave's API.
Read →A step-by-step guide to building an HTML certificate template with placeholders and rendering it to a polished PDF via the Docweave API.
Read →How to run high-volume PDF generation safely — concurrency limits, retries with idempotencyKey, failure handling, and why per-document pricing changes the math at scale.
Read →Why @page CSS doesn't give you running headers in Chromium-rendered PDFs, and how to use headerTemplate/footerTemplate to add page numbers, titles, and dates correctly.
Read →How Docweave's url source type renders a live web page to PDF, when to use it instead of raw HTML, and the auth/SSRF caveats that trip people up.
Read →A practical guide to getting images, logos, and web fonts to render correctly in generated PDFs — data URIs vs hosted assets, @font-face gotchas, and how Docweave's Chromium renderer handles both.
Read →The pattern for turning database rows into PDFs at scale: query, map to template data, render with a per-row idempotency key, store the result.
Read →Why webhooks and job queues redeliver the same event, how that causes duplicate PDFs and double-billing, and how to use idempotencyKey to make PDF generation safe to retry.
Read →How to turn markdown files (READMEs, docs, changelogs) into PDFs programmatically: convert to HTML with a markdown library, then send that HTML to a PDF API. Includes a working Node example.
Read →Generate your first PDF in minutes.
Get an API key