Skip to main content
HTML to PDF renders an HTML string in Cloudflare’s remote browser and returns the result as a PDF file. Use it for invoices, reports, certificates, and other documents assembled earlier in a workflow.

Inputs

Output

Put print-specific rules in the HTML with @media print. Page size, margins, headers, and footers can be supplied through Additional API Parameters when supported by Cloudflare’s PDF endpoint.
External stylesheets, fonts, and images must be reachable from Cloudflare’s browser. For the most portable document, use absolute URLs or embed the assets directly in the HTML.

Troubleshooting

Replace local and relative asset paths with public absolute URLs, or embed the asset in the HTML. The remote browser cannot access files on your computer or private network.
Set Wait For Selector to an element created after rendering finishes, or add a small Wait Time.