Back to articles
Generate PDFs from HTML, Markdown, or URL via API — Free, No Puppeteer Setup Required

Generate PDFs from HTML, Markdown, or URL via API — Free, No Puppeteer Setup Required

via Dev.to JavaScriptmiccho27

Setting up Puppeteer or wkhtmltopdf in production is a pain. Lambda cold starts, binary layer size limits, font rendering issues, memory spikes — every time I needed "just generate a PDF," it turned into a half-day infrastructure project. So I built a PDF Generator API on Cloudflare Workers that handles the heavy lifting. Send it HTML, Markdown, or a URL — get back a PDF. That's it. What You Get (Free Tier: 500 requests/month) HTML to PDF conversion (full CSS support) Markdown to PDF (code highlighting included) URL to PDF (render any public webpage) Custom page size: A4, Letter, Legal Configurable margins, headers, footers Landscape / portrait orientation Returns base64-encoded PDF or binary stream Quick Start Python — Invoice Generator import requests import base64 API_KEY = " your-rapidapi-key " headers = { " x-rapidapi-key " : API_KEY , " x-rapidapi-host " : " pdf-generator-api2.p.rapidapi.com " , " Content-Type " : " application/json " } # HTML to PDF invoice_html = """ <!DOCTYPE

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
3 views

Related Articles