services / html-to-pdf
visualoperational · 1136 ms
HTML to PDF
Render a URL or raw HTML string to PDF. Returns pdf_base64 (base64 PDF — decode to get raw bytes) and page_count. Provide url OR html — never both. Supports format (A4/Letter/Legal), landscape boolean, and margin settings (top/bottom/left/right in CSS units). Use for invoices, reports, or printable document generation.
Run free trial ↗1 free call per day with the example input. Paid: $0.008 USDC, no limit.
Call it
Input
| Field | Type | Description |
|---|
Output
| Field | Type | Description |
|---|---|---|
| pdf_base64 | string | Base64-encoded PDF bytes (decode to get raw PDF file) |
| page_count | integer | Number of pages in the generated PDF |
| file_size_bytes | integer | Size of the PDF in bytes |
| generated_at | string | ISO 8601 timestamp of generation |
Example response (data)
{
"pdf_base64": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9...",
"page_count": 2,
"file_size_bytes": 14867,
"generated_at": "2026-04-07T12:00:00.000Z"
}