HTML to PDF API

POST

Convert raw HTML markup into downloadable PDF documents.

HTML to PDF renders raw HTML markup into downloadable PDF files. Send your escaped HTML string to receive a signed download link, an expiration timestamp, and the generated document filename.

Try it — live request, no key required

Request
POSTapi.apiverve.com/v1/htmltopdf
Body
Verification
Format

No key required to try it. Get a key to use it in your app.

About the HTML to PDF API

HTML to PDF works by converting the HTML content provided into a PDF file. It uses advanced algorithms to convert the HTML content into a PDF file and returns the PDF file.

What people use it for

Billing Receipt Generation
SaaS billing engines convert rendered invoice templates into downloadable PDF links to attach to customer payment receipts.
Exporting Analytics Dashboards
When clients export quarterly business metrics, reporting portals turn dynamic table markup into formatted PDF documents for offline distribution.
Warehouse Packing Slips
Feed order summaries directly into PDF documents so distribution centers can fetch printable package inserts via temporary download URLs.
Archiving Legal Agreements
To store finalized contracts permanently, digital signature services convert signed HTML agreement summaries into dated PDF records.

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use HTML to PDF

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the HTML to PDF API.

Read the docs →
Which plan fits 2,500 PDF conversions a month?
The Starter plan easily covers this volume. At 20 credits per conversion, 2,500 documents consume 50,000 credits, which is one quarter of the Starter tier's monthly allowance. That works out to about $0.003 per conversion, or $3.00 per 1,000 documents. The Free plan includes 10 conversions each month for testing.
Are landscape orientation and custom margins available on the Free plan?
No, landscape orientation and margin controls require a paid plan. The Free plan produces documents using default portrait orientation and fixed margins. Upgrading to any paid tier, starting with Starter, unlocks the landscape option as well as top, bottom, left, and right margin adjustments.
Does the API return raw PDF binary data or a file link?
HTML to PDF returns a JSON response containing a signed download URL rather than raw binary data. Each conversion includes this URL alongside a unique filename identifier. You can fetch the file directly from the link to store it locally or serve it to your users.
How long does the generated PDF download link stay valid?
The download URL is temporary and comes with an expiration timestamp. The API response returns a Unix timestamp in the expires field that specifies exactly when the download link becomes invalid. You should download and persist the PDF file before that timestamp passes.
Does the HTML content require special formatting before sending?
Yes, your HTML string must be properly escaped inside the JSON payload. Unescaped quotes, unescaped line breaks, or invalid string formatting can prevent the request payload from parsing correctly.

Ready to build with HTML to PDF? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs