SynthPDF

HTML to PDF

Paste or write HTML and convert it to a PDF document. Processed on our server.

0 characters

HTML to PDF

Write or paste HTML to preview and convert

How It Works

1

Paste HTML or upload a file

Enter HTML code directly or upload a .html file. External CSS and images are supported.

2

We render it in a real browser

A headless Chromium instance renders your HTML exactly as a browser would — fonts, flexbox, grid, all included.

3

Download your PDF

Your pixel-perfect PDF is ready in seconds. Choose A4 or Letter, with optional print margins.

Why Convert HTML to PDF?

HTML is designed to be flexible and responsive — it adapts to screen size. PDF is designed to be fixed and exact — it looks identical on every device. When you need to share a web-based document as a fixed layout (for archiving, printing, or sending), converting HTML to PDF is the right approach.

Common use cases: generating invoices from web-based billing systems, archiving web pages, creating print-ready documents from email templates, and converting Markdown-rendered reports to PDF.

How Chromium Rendering Works

Our server uses a headless Chromium browser to render your HTML — the same engine that powers Chrome. This means:

  • All modern CSS is supported: Flexbox, CSS Grid, custom properties, calc()
  • Web fonts (Google Fonts, custom @font-face) load and render correctly
  • JavaScript executes before the PDF is captured — dynamic content renders correctly
  • External images and assets load if they're publicly accessible URLs
  • CSS @media print rules are respected — style the print version separately

Controlling Page Breaks

Use CSS to control where page breaks happen in the PDF:

  • break-before: page — force a page break before an element (e.g., each new section)
  • break-after: page — force a break after an element
  • break-inside: avoid — prevent a block (table, figure) from being split across pages
  • orphans: 3 and widows: 3 — control minimum lines at start/end of a page

Setting Up Print Styles

For precise control, add a @media print block to your CSS:

  • Hide navigation bars, sidebars, and footers that don't belong in the printed document
  • Set explicit font sizes in pt (not px) for print accuracy
  • Control margin sizes with @page { margin: 2cm; }
  • Remove background colours that look good on screen but waste ink when printed

Generating PDFs Programmatically

Pro users can call our HTML-to-PDF endpoint via API to automate document generation — useful for invoice generators, report builders, and documentation pipelines. See the API documentation for details.

Frequently Asked Questions

Yes — the renderer loads all linked stylesheets, fonts, and images. Add @print CSS for precise print styling.

Paste the page's source HTML. For live pages with JavaScript-rendered content, use our browser extension or the URL-to-PDF option.

A4, Letter, Legal, and custom dimensions. Choose portrait or landscape.

Use CSS `page-break-before: always` or `break-before: page` in your styles to force page breaks at specific elements.

Yes — up to 50 conversions/month on the free plan. Pro and above have higher limits.

Related Tools