Guides
Guides for the pdfrender API. They cover curl, Python and Node.js, the CSS that works, page layout, invoices, images and fonts, MCP, rate limits and errors.
-
Convert HTML to PDF with curl
Render HTML to PDF from the command line with one curl call. No API key is needed to start.
-
HTML to PDF in Python
Generate a PDF from HTML in Python with one requests call. No browser and no wkhtmltopdf to install.
-
HTML to PDF in Node.js
Render HTML to PDF from Node.js with the built-in fetch. No Puppeteer and no Chromium download.
-
PDF headers, footers and page numbers with CSS
Add headers, footers and "Page X of Y" numbers to generated PDFs with CSS @page margin boxes.
-
PDF page size, orientation and margins with CSS @page
Set A4, Letter, landscape or custom PDF page sizes and margins with the CSS @page rule. The API has no page size parameter.
-
What CSS works in pdfrender
Which CSS pdfrender supports for PDFs: page size, margin boxes, page counters, page breaks, fonts, flexbox and grid. Items tested on pdfrender are marked.
-
Generate invoice PDFs from HTML templates
Turn an HTML invoice template into a PDF: fill it with your template engine, set the page layout in CSS and POST it to /v1/render.
-
Images and custom fonts in API-rendered PDFs
pdfrender loads nothing from the network. Put images, fonts and CSS into the HTML as data: URIs, as shown here.
-
HTML to PDF from AI agents with MCP
The pdfrender MCP server gives agents a render_html_to_pdf tool that returns a download link to the PDF. Setup for Claude Code and other MCP clients.
-
API keys, rate limits and credits
How access to pdfrender works. Without a key you get 10 free renders a day per IP address. A key adds monthly credits and a higher limit.
-
Render limits and error codes
pdfrender's limits and error codes, from 400 external_resource_blocked to 504 render_timeout, with the fix for each.