HTML to PDF
PDF invoices and reports straight from your HTML
Reuse the templates you already have and stop maintaining rendering servers.
The problem
PDF libraries force you to rewrite layouts, and running your own Chromium in production costs memory, updates and engineering time.
The solution
Send the HTML and CSS you already use; the API renders it in a managed Chromium, with support for Google Fonts, per-page headers and footers, and JavaScript for charts.
How it works
Invoices and reports
Build the HTML
Use your current template engine to generate the invoice HTML.
Send it for conversion
POST /convert with the HTML and a webhook_url.
Deliver to the customer
When the webhook arrives, download the PDF and email it or attach it to the order.
- Layout identical to the web
- No rendering infrastructure
- Webhook when it's ready
curl -X POST 'https://api.respawntech.dev/v1/tools/document/pdf/convert' \
-H "X-API-Token: $RESPAWN_API_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"html": "<h1>Fatura #001</h1><p>Total: R$ 199,90</p>",
"format": "pdf",
"page_size": "A4",
"webhook_url": "https://seu-app.com/webhooks/pdf"
}'FAQ
Frequently asked questions
Can I number pages?
Yes. Use header_html and footer_html for a header and footer repeated on every page.
What about reports with JavaScript charts?
Enable enable_js and use wait_selector to wait for the chart to render before generating the PDF.
Start integrating today
Create your account, generate a token and make your first call in a few minutes.