Use cases

PDF generation for
the documents apps actually send

Each guide shows the request we'd send for that document, the HTML that prints cleanly, and where it tends to go wrong: rows splitting across pages, charts captured half-drawn, backgrounds that come out white.

What can you generate with an HTML to PDF API?

Anything you can build as a web page. Invoices, reports, contracts, certificates and dashboard exports come up most often. With htmltopdfapi.co you POST HTML or a URL and get a PDF back, rendered by headless Chromium, so flexbox, grid, web fonts and JavaScript charts work the way they do in Chrome. If the category is new to you, start with what an HTML to PDF API is.

Which approach fits?

Two decisions shape most of the output: whether you send html or a url, and which few options you set. The full parameter reference is in the guide.

Use caseInputKey optionsDeep-dive
Invoiceshtmlpaper_size a4/letter, margins, footer_html with page numbersInvoice PDF generator
Reportshtml or urlorientation landscape, header_html, wait_until networkidle0PDF microservice pattern
Contractshtmlmargins, footer_html with reference, CSS break-insideLaravel HTML to PDF
Certificateshtmlorientation landscape, margins 0, print_background, paper_width/heightCertificate PDF generator
Dashboard exporturl or htmlviewport_width, wait_for_selector, orientation landscapeDashboard to PDF

Frequently asked questions

Can't find what you need? Ask us.

What is an HTML to PDF API?

A hosted service you send HTML or a URL to over HTTP, and it returns a PDF. htmltopdfapi.co renders with headless Chromium on AWS Lambda, so modern CSS and JavaScript work. The full explanation is in What is an HTML to PDF API?

Should I send HTML or a URL?

Send html when your server already renders the document, such as invoices, contracts and certificates; it keeps private data out of public URLs. Send url when the page is built in the browser with JavaScript, such as charts and dashboards, and pair it with wait_until or wait_for_selector.

Which languages can I use?

Anything that can make an HTTPS POST. PHP and Laravel have an official SDK (composer require htmltopdfapi/php-sdk); from Node.js, Python, Ruby or Go you call the REST endpoint with your usual HTTP client. See the integration guide.

How much does it cost?

The Free plan gives you 200 pages a day without a credit card. Pro is $29/month for 50,000 pages and 5 API keys. Enterprise is priced per contract, with unlimited pages, 100 MB input and an SLA. Billing counts rendered PDF pages, not requests. See pricing.