Quickstart
Three steps: get a key, send a request, save the file that comes back.
1. Get an API key
Create an account. Your first key is shown on the dashboard straight after sign-up. Copy it then; we only store a hash. Put it in an environment variable:
Terminal
export PAGENULL_API_KEY="pm_live_…"2. Turn HTML into a PDF
POST /v1/pdf with a JSON body. The response body is the PDF (application/pdf), so write it straight to a file.
curl https://api.pagenull.dev/v1/pdf \
-H "Authorization: Bearer $PAGENULL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<h1>Hello from pagenull</h1><p>Rendered by headless Chromium.</p>",
"format": "A4"
}' \
-o hello.pdf3. Or render a public URL
Pass url instead of html. We load it in a fresh browser context with no cookies. Addresses on private networks, localhost and cloud metadata endpoints are refused.
curl https://api.pagenull.dev/v1/pdf \
-H "Authorization: Bearer $PAGENULL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "Letter",
"margin": {
"top": "15mm",
"bottom": "15mm"
}
}' \
-o example.pdfNext
- API reference: every option, error code and limit.
- Templates: save HTML once and render it with JSON.
- HTML to PDF in Node.js, step by step.