This prints a single HTML file to PDF with headless Chromium, the engine behind Chrome. It is built for self-contained documents such as invoices, reports and generated statements. Two rules shape the result: scripts in the page are not run, and nothing outside the uploaded file is loaded. Styles written in the file and images embedded as data URIs render; linked stylesheets, remote images and web fonts do not.
How to use it
- Make the page self-contained: put the CSS in a style block and embed images as data URIs.
- Drop the .html or .htm file on the page, or click to choose it.
- Choose a Paper size, an Orientation and Margins, or leave them at A4, Portrait and Normal (15 mm).
- Click Convert to PDF.
- Download the PDF and check images, fonts and page breaks.
What renders and what is blocked
The file is served to the browser under a policy that allows the document itself and nothing else. Only one file can be uploaded, so even an image sitting next to the page on your disk is out of reach.
- Rendered: the markup, style blocks and style attributes, inline SVG, and images and fonts embedded as data URIs.
- Not run: every script, inline or linked. A page that builds its content with JavaScript prints as its static markup, which may be an empty shell.
- Not loaded: stylesheets, images and fonts referenced by a web address or a relative path, plus frames, embedded objects, audio and video.
Page size, margins and print styles
Pages are A4 portrait with a 15 mm margin on every side unless you choose otherwise. Paper size offers A4, Letter, Legal, A3 and A5; Orientation offers Portrait and Landscape; Margins offers None, Narrow (6 mm), Normal (15 mm) and Wide (25 mm). A size and margins declared in an @page rule in your own CSS take precedence over these choices, so a page designed for Letter or for wide sheets prints the way it was designed. Printing applies print media, so rules inside a print media query take effect and screen-only rules do not.
The date, title and address line that a browser normally prints at the top and bottom of each sheet are switched off. The PDF is tagged, so headings, lists and table header cells keep their roles for screen readers.
Fonts and character encoding
Text is drawn with fonts installed on the server. Arial, Helvetica, Times New Roman, Courier New, Calibri and Cambria resolve to lookalikes of the same widths; other named fonts fall back to a default. To keep a specific typeface, embed it in the file as a data URI inside a font-face rule. Chinese, Japanese and Korean text is drawn in a general-purpose font for those scripts.
The encoding is whatever the page declares in its meta charset tag. With no declaration the browser guesses, and accented letters can turn into wrong symbols; declare UTF-8 and save the file that way.
Questions
Can I convert a web page to PDF from its URL?
No. The tool takes an uploaded file and never fetches an address. A page saved from a website also depends on outside stylesheets and images that will not load, so for a live site use your browser print dialog and choose Save as PDF.
Why are the images missing from my PDF?
They are referenced by a link or a file path, and nothing outside the HTML file is loaded. Embed each image in the file as a base64 data URI and convert again.
Why does my page come out blank or unstyled?
Blank usually means the content is created by JavaScript, which does not run. Unstyled means the CSS lives in a linked stylesheet. Move the styles into the file and render the content to static HTML first.
How do I get A4 or landscape pages?
A4 portrait is the default. For anything else, pick it under Paper size and Orientation before converting. If the result ignores your choice, the file has its own @page rule, which wins; change the size there. To put the pages of a PDF you already have onto A4, Letter or another paper size, use Resize PDF pages, which scales each page to fit the new sheet.
Can I convert an HTML fragment without html and body tags?
Yes. Markup with no doctype and no html element, as a template or a content system produces, is wrapped in a minimal document and read as UTF-8. For Markdown use Markdown to PDF, and for a saved email Email to PDF.
Is the HTML file kept on the server?
No longer than one hour; it and the PDF are then deleted automatically. The renderer has no route to the internet, which is also why remote content never loads.