Generate PDFs in FastAPI with Api2Pdf: Streaming Responses, Background Tasks and Jinja2
Build PDF downloads in FastAPI: a typed Api2Pdf client with httpx, StreamingResponse for invoices, BackgroundTasks for email, and Jinja2 ...
The tools you already trust, Headless Chrome, wkhtmltopdf and LibreOffice, wrapped in one transparent, serverless REST API.
API2PDF exists to make generating PDFs for application developers not completely miserable. Fast, cheap and without arbitrary limits. Popular libraries and APIs such as iTextSharp, PDFCrowd and DocRaptor are unreasonably expensive; you should not have to break the bank to convert HTML to PDF.
Most services hide what they run under the hood. API2PDF does the opposite: Headless Chrome, wkhtmltopdf, LibreOffice and PdfSharp are named up front, so you know exactly what you are buying and can test your HTML locally first.
Every request runs in its own container on Google Cloud Run with 2 GB of RAM and 90 seconds of compute (more on the V2 XL endpoints). There are no queues, no rate limits and no file size limits, and you pay $1 a month plus a fraction of a cent per request. See the pricing page and the comparison with 18 other PDF APIs.
One REST API, client libraries for Python, Node, PHP, C# and Java, an MCP server for AI coding assistants, x402 pay-per-request for autonomous agents, and a plain-English fact sheet about infrastructure and data handling.

Build PDF downloads in FastAPI: a typed Api2Pdf client with httpx, StreamingResponse for invoices, BackgroundTasks for email, and Jinja2 ...

Generate PDFs in Next.js 15 and 16: a server-only Api2Pdf client, a Route Handler that streams the PDF, Server Actions, and printing Reac...

Generate Code 128 and QR codes with the Api2Pdf /zebra endpoint and render 4x6 shipping labels and signed event tickets as PDFs. Python a...
Start free, hit the docs, and move from prototype to production without turning PDF generation into its own internal platform project.