Skip to content

HTML to PDF

Render HTML files as PDF.

On a secure serverTakes HTML; makes PDF.
Web page captureChecking…

HTML to PDF runs on our secure server

Page layout

Checking our secure server…

About this tool

Convert an HTML file into PDF with a real Chromium rendering engine on a secure server that deletes the input when the job finishes.

Files are processed on a secure server, which deletes the upload when the job ends and serves the result for a limited time.

More details

HTML to PDF takes one .html or .htm file and prints it the way a browser would. Headless Chromium, the open-source engine behind Chrome, lays out the markup with the CSS inside the file, runs its JavaScript within a bounded rendering window, and prints the result. Because it is a print rather than a screenshot, text stays selectable, @media print rules take effect, and a CSS @page rule decides the paper size.

Chromium does not run in your browser, so this is an upload: the file goes over TLS to pdf.xyz's secure server, which deletes it when the job finishes (and within 60 minutes in any case). The PDF's download link lasts 60 minutes, and a daily storage rule erases the stored copy after that.

Only the single file you choose is uploaded. A stylesheet, image or font referenced by a path such as css/site.css sits on your computer, not beside the upload, so it has nothing to load. Self-contained HTML works best: CSS in a <style> block, images and fonts embedded as data: URIs. To capture a page that is already online, give its address to Webpage to PDF instead.

When to use it

  • Print an HTML email template or invoice

    Templates like these tend to keep their styling inline in one file, which is the shape this tool handles best. Embed the logo as a data: URI rather than pointing at an image file, and add @page { size: A4 } when the recipient expects A4 rather than US Letter.

  • Turn a static report into something you can send

    When a test, coverage or analytics tool offers a single-file HTML report, pick it: its styles and data travel inside the upload. The multi-file kind, a page plus a folder of scripts and images, prints without whatever lives in that folder.

  • Proof a print stylesheet before it ships

    Open the PDF to see which elements your @media print rules hide, reflow or reveal on paper, straight from the file on your disk with no server to deploy to. Nothing is added in the top and bottom margins: no print date, title or page count appears unless your page draws it.

  • Rescue the text of a saved web page

    Saving a page as “Webpage, Complete” writes an .html file plus a folder of assets. Only the .html travels here, so text written into the markup survives, while the styling and pictures in that folder do not.

How it works

  1. 1Add your HTML file

    Drag one .html or .htm file onto the dashed drop zone, or click it to pick one. The name then appears with a Remove button. The drop zone works before the page has heard from our server; the file is sent only when you press Render PDF, and that button stays off until a secure server is ready. When none is, the panel says why and offers a “Notify me when this ships” button.

  2. 2Choose the page layout, if you want one

    Under Page layout, pick a Page size (A4, Letter, Legal, A3, or A5), Portrait or Landscape, the Margins, a Screen width, or tick One long page. Left as they are, the page's own print settings decide the layout.

  3. 3Click Render PDF

    It stays disabled until a file is added. Once clicked, its label follows the job: “Uploading your file…”, then “Waiting for our server…” if the queue is busy, “Rendering PDF…” while Chromium prints, and “Downloading the result…”. A Cancel button below it stops the job at any point.

  4. 4Download the PDF

    When “Your PDF is ready.” appears, click the button reading Download plus the file name. The PDF is named after your file, ending in .pdf instead of .html or .htm. A failure shows an error note instead.

Common questions

Is my HTML file uploaded, and how long is it kept?

Yes, over TLS, because Chromium runs on our secure server. The upload is removed when the job ends, success or failure, and within 60 minutes regardless. The download link works for 60 minutes; a daily storage rule then erases the stored PDF, typically a few hours later.

Why are my images, fonts or stylesheet missing from the PDF?

Usually a relative path. Our server receives your one HTML file and nothing else, so src="images/logo.png", href="style.css" or /img/logo.png point at files it never had. Paste the CSS into a <style> element, embed images and fonts as data: URIs, and render again.

Does JavaScript run before the page is printed?

Yes, within a fixed budget of rendering time, so a chart or table built by script can appear. Content that waits on a long timer, or on other files the page links to, which our server never receives, may be missing.

Can I choose the page size, margins or orientation?

Yes, under Page layout: Page size (A4, Letter, Legal, A3, or A5), Orientation, Margins (None, Small, or Normal), Screen width and One long page. Leave Page size on As the page sets it and a CSS @page rule in your file still decides the paper, US Letter when there is none; choose a size, a screen width or One long page and your choice decides it instead. Screen width lays the page out as on a 1280, 768, or 390 pixel wide screen and scales it to fit the paper. One long page prints the whole page on a single page as tall as its content, up to 200 inches; anything longer continues on more pages.

Does the PDF get a date, a title or a file path on every page?

No. Our server asks Chromium for the page alone, so no print date, <title>, file location or page count is added at the top or bottom of any page. For page numbers or a running header, add them afterwards with Add Page Numbers or PDF Header & Footer.

What happens if the file is too big or will not render?

One HTML file of up to 20.0 MB per run, the most Chromium is handed: a larger one is refused as soon as you pick it, before anything is uploaded. Images embedded as data: URIs count toward it, and base64 makes each one about a third larger than the image file itself. If Chromium crashes or produces no usable PDF, our server tries again, and when every attempt fails the note reports that Chromium could not render the file. If the page stops waiting while the render is still going, a note says our server is still on the job and offers Keep waiting, which picks up the same job rather than uploading the file again or starting a new one, or Cancel the job; a finished PDF stays available for 60 minutes.

How large can my file be?

Up to 20 MB per file.

Will the images and styles my HTML links to appear?

Only those it can reach without other files from your computer: the .html file is uploaded on its own, so an image, stylesheet or script it links by a relative path (such as images/logo.png) is missing from the PDF. Styles written into the file itself, and files linked by a full web address, are loaded.

No sign-up required. Your files stay on your device until you run a tool.