Skip to content
HTML TO PDF · NODE.JS

HTML to PDF in Node.js

Generate pixel-perfect PDFs from HTML or any URL in Node.js — without running Puppeteer yourself. One POST to RenderKit returns a signed PDF URL with real Chromium print CSS.

Self-hosting headless Chrome in Node.js means a memory-leaking browser process you restart at 2am. RenderKit's /v1/pdf endpoint is the managed alternative: POST a JSON spec, get a signed PDF URL back. Print CSS, custom page size, margins, and running headers/footers are all supported.

Node.js example

Install the SDK: npm i renderkit-sdk (or the Node.js equivalent).

pdf.node-js
import { RenderKit } from "renderkit-sdk";
const rk = new RenderKit(process.env.RENDERKIT_API_KEY);
const pdf = await rk.pdf({ url: "https://example.com", format: "A4" });
console.log(pdf.url); // signed CDN URL

What's included

  • Chromium print pipeline — real @media print, not an HTML approximation
  • Custom page size, margins, landscape/portrait, print-background
  • Running headers/footers with page numbers
  • Signed CDN URL response — stream it or redirect to it
  • Same key also does screenshots and markdown extraction

More

See the full HTML to PDF API reference, JSX-to-PDF for component-native documents, or compare RenderKit vs PDFShift.

Common questions

POST your URL or raw HTML to RenderKit's /v1/pdf endpoint with your API key. The response is a signed URL to the generated PDF — no headless browser to install or host in Node.js.

No. RenderKit hosts the browser fleet. You send a JSON request and receive a finished PDF, which removes the memory and concurrency problems of self-hosting.

Ship your first render in 60 seconds.

500 free renders to start. No card. Cancel by ignoring it.

Get your free key$npm i renderkit-sdk