Send HTML or a public URL and get a PDF printed by headless Chromium, so the result matches Chrome print preview: modern CSS, web fonts and JavaScript all work. Set the page size, margins, scale, headers and footers, and wait for a selector before printing. Every request the page makes passes the same private-address guard as our file downloads.
Questions
Does JavaScript run?
Yes. By default the page prints when the network goes quiet. Use wait_for_selector for pages that render late, or delay_ms for a fixed wait.
Can the page load images from my internal network?
No. Requests to private, loopback and cloud metadata addresses are blocked, from the HTML and from anything it loads. Use public URLs or data URIs.
How do I add page numbers in the footer?
Use footer_html with the classes pageNumber and totalPages, like .
Use cases and what they cost
| Use case | What it does | Calls a month | Estimated cost a month |
|---|---|---|---|
| SaaS invoices | Renders one invoice per customer per month from an HTML template. | 3,000 | $16.00 |
| Reports from a dashboard | Saves a dashboard page as PDF for weekly emails. | 800 | $4.80 |
| Tickets and certificates | Generates event tickets and course certificates. | 25,000 | $111 |
- SaaS invoices: Header and footer HTML for page numbers.
- Reports from a dashboard:
urlwith wait for a selector. - Tickets and certificates: Third tier from call 10,001.
Costs use the published volume tiers: the first 1,000 calls of the month at tier 1, calls 1,001 to 10,000 at tier 2, and every call after that at tier 3. Failed calls cost nothing, so they are not in these figures.
Recommendations
- Send
htmlfor templates you control; sendurlfor live pages. Private and internal addresses are refused. - Use
wait_for_selectorwhen a page draws charts with JavaScript, so the PDF is not blank. - Put page numbers in
footer_htmlwith thepageNumberandtotalPagesclasses. - Use print CSS (
@media print,page-break-before) to control where pages break.
How it compares
HTML to PDF is where specialist services such as PDFShift compete hard, and a subscription can be the cheaper choice at steady high volume. Flat per-call pricing wins on spiky or low volume.
| Provider | How they bill | Cost of one job (a 10-page document) |
|---|---|---|
| JustAPI | Flat $0.006 per call at tier 1, any size; failures free | $0.006 |
| PDF.co | HTML to PDF: 9 credits per page | $0.05 |
| PDFShift | Boost plan: 24 USD a month for 2,500 credits, 1 credit per 5 MB of output | $0.01 |
| iLoveAPI | 10 credits per file | n/a |
| ConvertAPI | Developer plan: 35 USD a month for 1,000 conversions | $0.04 |
Prices checked on 12 November 2026 on each provider's public pricing page. PDF.co figures use their Basic plan (8.99 USD a month on annual billing for 16,500 credits). iLoveAPI does not publish dollar prices for paid credits on its pricing page, so only its credit cost is shown. Plans change; check before you decide.
Pick PDFShift or a similar specialist if you render tens of thousands of PDFs every month at a steady rate and want their extras, such as S3 delivery. The full working is in HTML to PDF API pricing compared: 5 services, 3 bills, and the step-by-step setup is in the HTML to PDF integration guide.
Try it free first
The free html to pdf tool runs the same job in your browser, five times a day, with no account. Use the API for workflows and bigger files. The full parameter list is in the HTML to PDF API reference.