Paste your HTML (or HTML + inline CSS) and render it to a clean, paginated A4 PDF — also available as an API.
Open HTML to PDFThe same engine is one POST away. Send the HTML with your API key; the response carries a link to the finished PDF. Create a key in the app under API keys — the full reference is at /docs.
import os, requests
r = requests.post(
"https://mostly-pdf.web.app/v1/process",
headers={"Authorization": f"Bearer {os.environ['MOSTLYPDF_API_KEY']}"},
json={"tool": "html-to-pdf",
"options": {"html": "<h1>Invoice #42</h1><p>Thank you!</p>", "paper": "A4"}},
timeout=60,
)
r.raise_for_status()
pdf = requests.get(r.json()["pdfUrl"], timeout=60).content
with open("invoice.pdf", "wb") as f:
f.write(pdf)
// Node 18+ (ES module) — fetch is built in
import { writeFile } from 'node:fs/promises';
const res = await fetch('https://mostly-pdf.web.app/v1/process', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MOSTLYPDF_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
tool: 'html-to-pdf',
options: { html: '<h1>Invoice #42</h1><p>Thank you!</p>', paper: 'A4' },
}),
});
if (!res.ok) throw new Error(await res.text());
const { pdfUrl } = await res.json();
await writeFile('invoice.pdf', Buffer.from(await (await fetch(pdfUrl)).arrayBuffer()));
Yes — HTML to PDF is free with no sign-up, no watermark and no daily limit on this tool. Heavier operations (OCR, conversion) have a generous daily quota on the free plan and are unlimited on Pro.
Open HTML to PDF, drop your file, set the options, and download the result in a few seconds — processed securely, no queue and no ads.
HTML to PDF needs our conversion servers, so the file is sent over an encrypted connection, used only for your task and deleted within 24 hours. The page tools (merge, split, rotate, organize, page numbers, watermark, crop, form filling, image to PDF) run entirely in your browser instead and never upload anything.
Yes. The HTML is rendered by a real headless browser, so your CSS, web fonts and layout are applied exactly as they would be on screen, then paginated with print margins.
Yes — the same conversion is available on the MostlyPDF API: send the HTML with your API key and get back a hosted PDF URL. It runs on MostlyRender, the Chromium print-to-PDF engine behind these tools.
Compare: MostlyPDF vs iLovePDF · MostlyPDF vs Smallpdf · MostlyPDF vs PDF24 · MostlyPDF vs Sejda · MostlyPDF vs Stirling PDF
A Mostly Tiny product · All tools