Install
openclaw skills install generate-pdfGenerate a PDF document from HTML content or a public URL. Supports custom page sizes, fonts, margins, viewport dimensions, dynamic parameter substitution, and multiple output formats.
openclaw skills install generate-pdfGenerates a PDF document from either raw HTML content or a public URL using a headless Chromium browser. The API renders the page and returns the result as a downloadable URL, base64 string, or raw PDF file.
You must provide one of:
html_content — raw HTML string to renderurl — a public URL to convertSend your API key in the CLIENT-API-KEY header.
Get your free API key at https://pdfapihub.com. Full API documentation is available at https://pdfapihub.com/docs.
| Parameter | Description |
|---|---|
output_format | url (default), base64, file/pdf/binary |
paper_size | A4, A3, A5, Letter, Legal, Tabloid |
landscape | true for landscape orientation |
margin | Object with top, right, bottom, left (e.g. "10mm") |
font | Google Font names, pipe-separated |
dynamic_params | Key-value object for {{placeholder}} replacement |
wait_till | Seconds to wait before rendering (for JS-heavy pages) |
curl -X POST https://pdfapihub.com/api/v1/generatePdf \
-H "CLIENT-API-KEY: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"html_content": "<html><body><h1>Invoice #{{invoice_id}}</h1><p>Total: {{total}}</p></body></html>",
"css_content": "body { font-family: Arial; }",
"dynamic_params": { "invoice_id": "INV-001", "total": "$1,249.00" },
"paper_size": "A4",
"output_format": "url"
}'
"true", "1", "yes", "on"