HTML to PDF
OperationalConvert HTML markup or live URLs to pixel-perfect PDFs
API Overview
The HTML to PDF API renders HTML to PDF with full CSS3 and JavaScript support using a headless browser engine at the edge. You can submit raw HTML markup or point to any public URL. Control page dimensions (A4, Letter, custom), set margins, inject custom headers and footers with page numbers, and configure the viewport width. Ideal for generating invoices, reports, statements, and any document that lives first as HTML.
Full CSS3 Rendering
Headless browser engine renders fonts, flexbox, and custom styles with pixel-perfect accuracy.
URL or HTML Input
Convert any public URL or submit raw HTML — both modes return a base64-encoded PDF.
Custom Headers & Footers
Inject headers, footers, and automatic page numbers for professional document output.
Instant Response
Synchronous API — receive your PDF inline without polling or webhooks.
terminal API Playground
Live Simulationimport requests
url = "https://api.picopayd.codefission.co.uk/document/api/convert"
headers = {
"Content-Type": "application/json",
"X-PAYMENT": "<402-payment-token>"
}
payload = {
"type": "html",
"content": "<h1>Invoice #1234</h1><p>Amount due: $99.00</p>",
"options": {"format": "A4"}
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(f"Pages: {data['pages']}, Size: {data['sizeBytes']} bytes") {
"success": true,
"pdf": "JVBERi0xLjQKJe...",
"encoding": "base64",
"pages": 1,
"sizeBytes": 14320
}