Last updated: . Every code sample on this page was run against the live API with the sandbox key on that date.
Short answer: If you only need HTML/CSS → PDF (invoices, reports, letters), replace page.pdf() with one POST https://rendlet.com/v1/pdf. You drop the Chromium binary from your image, skip --no-sandbox flags, and keep using the same HTML you already generate. Rendlet still renders with headless Chromium — just on its side.
| Self-hosted Puppeteer | Rendlet API | |
|---|---|---|
| Install | Chrome / Chromium in every container or CI runner | Nothing: one HTTPS call |
| Cold start / memory | Hundreds of MB for the browser | Your function stays small |
| JavaScript in the page | Runs (if you wait for it) | Not run (send finished HTML) |
| Login / cookies / live URL | Yes | No — send HTML you already have |
| Ops | You patch Chrome and handle crashes | Hard monthly caps, no overage billing |
Full trade-offs: Rendlet vs self-hosted Puppeteer. Migrating off archived wkhtmltopdf: Rendlet vs wkhtmltopdf.
The public sandbox key needs no signup (5 renders a day per network, 1 page, up to 50 KB, faint watermark).
# Works as-is with the public sandbox key. With your own key: export RENDLET_API_KEY=YOUR_API_KEY
curl -X POST https://rendlet.com/v1/pdf \
-H "Authorization: Bearer ${RENDLET_API_KEY:-sandbox}" \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Hello</h1><p>Rendered by Rendlet.</p>","options":{"format":"A4","margin":"15mm"}}' \
-o hello.pdf
Before (you launch Chrome):
// Self-hosted Puppeteer (you install and run Chrome)
import puppeteer from "puppeteer";
const browser = await puppeteer.launch({ args: ["--no-sandbox"] });
const page = await browser.newPage();
await page.setContent("<h1>Hello</h1><p>Rendered locally.</p>", { waitUntil: "networkidle0" });
await page.pdf({ path: "hello.pdf", format: "A4", margin: { top: "15mm", bottom: "15mm", left: "15mm", right: "15mm" } });
await browser.close();
After (same PDF shape, no Chrome in your app). When we ran this against the live sandbox on 2026-11-07: saved hello.pdf; … renders left with X-Pages: 1 and a ~12 KB PDF.
// Same result via Rendlet (Node 18+, no Chrome in your app)
import { writeFile } from "node:fs/promises";
const res = await fetch("https://rendlet.com/v1/pdf", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RENDLET_API_KEY ?? "sandbox"}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
html: "<h1>Hello</h1><p>Rendered by Rendlet.</p>",
options: { format: "A4", margin: "15mm" },
}),
});
if (!res.ok) throw new Error(`Rendlet ${res.status}: ${await res.text()}`);
await writeFile("hello.pdf", Buffer.from(await res.arrayBuffer()));
console.log("saved hello.pdf;", res.headers.get("x-quota-remaining"), "renders left");
Map Puppeteer options roughly like this: format → options.format, CSS margins → options.margin, printBackground: true → options.printBackground, landscape: true → options.landscape. Build the HTML first (your template engine or a finished string); do not rely on client-side JS or a private URL.
Keep a self-hosted browser if the page needs JavaScript to finish (charts, SPAs), a logged-in session, or you must print a live URL you don't control. In those cases Rendlet is the wrong tool — use Puppeteer/Playwright yourself, or fetch HTML first and then call the API.
| Field | Values |
|---|---|
options.format | A4, Letter, Legal, A3, A5 |
options.landscape | true / false |
options.margin | CSS length, e.g. "15mm" or "0" |
options.printBackground | true / false |
filename | Name used in the Content-Disposition header |
response | "binary" (default) or "base64": JSON {filename, pages, bytes, content_type, base64} |
For HTML input, JavaScript in the page is not run, and only data: URIs and public https:// assets (images, fonts, CSS) load. Inline your CSS or link it over https. Simplified Chinese works out of the box (Noto Sans SC is bundled).
Successful renders return X-Pages, X-Plan, X-Quota-Limit and X-Quota-Remaining. Errors are JSON like {"error":"...","message":"..."}: 400 bad request, 401 missing key, 403 invalid key, 413 HTML too large or too many pages, 429 quota exceeded, 500 render failed.
| Sandbox | Free | Starter | Pro | Scale | |
|---|---|---|---|---|---|
| Price | $0 | $0 | $7/mo | $19/mo | $59/mo |
| Documents | 5 / day / network | 100 / month | 1,000 / month | 5,000 / month | 25,000 / month |
| Requests per minute | 3 | 10 | 30 | 60 | 120 |
| Pages per document | 1 | 10 | 50 | 200 | 500 |
| HTML size | 50 KB | 1 MB | 2 MB | 2 MB | 2 MB |
Every plan has a hard monthly cap: at the cap the API returns 429 with an upgrade_url, and you are never billed for overage. Failed renders don't count. Source: docs.