Search DevFox

Search tools and pages.

HTML to PDF

Render pasted HTML or a remote URL into a downloadable PDF

Loading tool...

What is HTML to PDF

Written by Giorgos Kostas. Last reviewed:

HTML to PDF converts pasted HTML or a public URL into a PDF that can be previewed and downloaded from the browser.

Choose A4 or Letter paper, set the margin in millimetres, select landscape orientation, and decide whether to print background graphics.

Why use it

  • Create a downloadable PDF from an HTML fragment or a public page URL.
  • Set paper size, margins, orientation, and background printing before rendering.
  • Preview the generated PDF before downloading it.

Features

  • HTML source or public URL input mode
  • A4 or Letter page size
  • Margin control in millimetres and landscape orientation
  • Optional print-background setting
  • In-browser PDF preview and download

How to use HTML to PDF

  1. Choose HTML or URL. Select HTML to paste markup or URL to render a public page.
  2. Choose page options. Pick A4 or Letter, set a margin in millimetres, and choose portrait or landscape orientation.
  3. Toggle background graphics. Enable 'Print background' if your CSS uses body backgrounds you want rendered into the PDF.
  4. Render and download. Click Generate PDF, review the preview, and download the result.

Example (before/after)

HTML input

Paste your HTML input so it can be converted into PDF for your next step.

PDF output

Get PDF output converted from HTML that is ready to review, copy, or export into the next step of your workflow.

Common errors

Source format does not match the tool

Conversions fail when the pasted input is not actually in the expected source format.

Fix: Verify the source format first, then paste it into the correct converter.

Partial or inconsistent data

Broken rows, missing fields, or incomplete markup can block conversion.

Fix: Use a complete input sample with the structure intact before converting it.

Unexpected output assumptions

Different target formats can flatten, restructure, or serialize values differently.

Fix: Review the converted output and confirm it matches the target system before using it downstream.

FAQ

Can I convert a password-protected or authenticated URL?

No — the renderer is a stateless headless browser that can only fetch public URLs. For pages behind a login, paste the HTML source directly (open the page, 'View Source', copy into the editor) or use our HTML to PDF API from inside your authenticated app.

Can I pick a specific page size for the PDF output?

Yes. Choose A4 or Letter. You can also set a margin in millimetres and switch between portrait and landscape orientation.