Blog
From HTML to PDF in 5 minutes
The fastest way to evaluate a PDF API is to render a real document, not read marketing copy. Here is the complete path from zero to your first invoice in about five minutes — all you need is a terminal.
Step 1 — Get a key (1 minute)
Sign in and open the dashboard, then press Create key. It is live the moment it is created, with 500 free pages every month and no card required. Treat the key like a password: keep it in an environment variable, never in client-side code.
Step 2 — Send your first request (1 minute)
Paste this into your terminal, replacing the key with your own:
curl -X POST https://www.pdfpilot24.com/api/v1/pdf/html \
-H "Authorization: Bearer pp24_live_…" \
-H "Content-Type: application/json" \
-d '{
"html": "<h1>Invoice 1042</h1><p>Acme Pvt Ltd</p>",
"paper": "A4",
"printBackground": true,
"filename": "invoice-1042.pdf"
}' \
--output invoice-1042.pdfThe flags do the obvious things: A4 sets the paper size, printBackground keeps your CSS backgrounds, and filename controls the download name. The PDF lands in your working directory as invoice-1042.pdf.
Step 3 — Read the response headers (1 minute)
Every response tells you what the render cost:
x-pdfpilot-pages— pages generated, and therefore credits usedx-pdfpilot-credits-remaining— your balance after this requestx-pdfpilot-request-id— quote this if you ever contact support
Step 4 — Make it yours (2 minutes)
Replace the sample HTML with your own template — inline your CSS, use web-safe or system fonts, and set explicit print margins. When the layout looks right in Chrome, it will look right in the PDF, because it is the same engine. From here, the endpoints reference covers URLs, Markdown, Office files and PDF tools such as watermarks.