Skip to content

HTML to PDF

Convert pasted HTML and CSS to a PDF. The HTML is sanitized on the server, then printed by a headless browser with scripts and network access switched off.

•

Security: your HTML is sanitized on the server. Scripts, iframes, forms, SVG and external resources are removed; images must be embedded as data: URIs. Limit: 1 MB.

What this tool does

Paste HTML and CSS, choose the page size, orientation and margins, and get a PDF of how it prints. It accepts HTML only. Pasting a web address does not work: the older URL mode was removed because loading arbitrary pages on a server is a security risk.

How to use it

  1. Paste your HTML and CSS into the editor, or press Load Sample Template.
  2. Choose the Page Size (A4, Letter or A3), Orientation, Page Margins and whether to print background colours and graphics.
  3. If a verification check is shown, complete it.
  4. Press Convert to PDF, then Download PDF within 15 minutes.

What happens to your HTML

All pasted HTML is treated as untrusted. The server rebuilds it from scratch and keeps only a list of safe elements, attributes and CSS properties. These are removed, together with their content:

  • Scripts, event handlers such as onclick, iframes, objects, embeds, forms, inputs, video, audio and SVG.
  • Link, meta and base tags, and @import, @font-face and other CSS at-rules.
  • Any image or CSS url() that isn’t a data: image.

The cleaned document is then printed by a headless browser with JavaScript off and network access off, and a strict content security policy in the page. If the browser isn’t available on the server, a simpler renderer is used, and it understands less CSS.

Writing HTML that converts well

  • Embed images as data: URIs (PNG, JPEG, GIF or WebP, with a real image inside). Normal image links are not loaded, because the renderer has no network access.
  • Web fonts are not loaded either, so the PDF uses fonts installed on the server. Choose common font stacks.
  • Use print-friendly CSS: a sensible page size, and page-break-inside: avoid on blocks such as table rows and cards.
  • If you paste a fragment without an html tag, the tool wraps it in a plain document with a readable default font.

Limits and privacy

  • Up to 1 MB of HTML, about 8,000 elements and text nodes, nesting 40 levels deep, 30 images and 400 KB of CSS.
  • Six conversions per 10 minutes per visitor, 20 per account for logged-in users, and at most three conversions running at once. Each conversion has a time limit of about 25 seconds.
  • The generated PDF sits in a temporary folder with a download link that works for 15 minutes and for one download. Don’t paste confidential pages, since the HTML is processed on the server.

Can I convert a web page from its address?

No. Only pasted HTML is accepted. The URL mode was removed for security reasons.

Why were my script, iframe or form removed?

The tool sanitizes all HTML before printing. Scripts, event handlers, iframes, objects, forms, SVG and external resources are removed, so they can’t be used to attack the server.

Why aren’t my images or fonts showing?

The renderer has no network access, so linked images and web fonts are not loaded. Embed images as data: URIs, and use fonts that are installed on the server.

Does it support modern CSS?

Flexbox, grid and most layout properties work when the headless browser is used. Properties outside the safe list are dropped, and the fallback renderer supports much less.

Is there a limit on how often I can use it?

Yes. Six conversions per 10 minutes per visitor, or 20 for a logged-in account, with a size limit of 1 MB of HTML. Verification may be required.