HTML to PDF: Choose a Viewport Before You Print
HTML to PDF renders a live page or a block of markup at a chosen screen width, then places the result on paper. The width decides the layout you capture; the page settings decide how that layout is divided.
Why this comes up
Web pages are built to reflow, and a PDF is expected to stay put. Archiving, sharing or filing a page means choosing which version of its layout should be frozen, and that choice happens before conversion.
Check before you run it
- Pick the viewport that matches the reader. 1200px is a normal desktop view, 1440px and 1920px show wider layouts, and 768px or 320px capture tablet and phone versions. The page reflows to the width you choose.
- Use the print stylesheet when the site has one. It usually hides navigation and expands content for paper. Ad and overlay blocking can remove clutter, but check that they did not remove something you needed.
- Decide between one long page and paginated output. Paginated A4 or Letter is easier to print and cite; one long page keeps a continuous design intact. Check tables and code blocks at the break points.
When to reach for it
- You need to record what a page said on a date. Turn on the URL and date line, keep the print stylesheet, and archive the PDF with the address visible.
- A client wants the mobile version as a document. Render at 320px so the phone layout is captured, not the desktop layout squeezed onto a narrow sheet.
One question we get
What input can I give it?
A web address, an uploaded .html file, or pasted code — the page is fetched and printed to PDF with its styles, ready to archive or send.
Where it fits
The tools people usually open next to HTML to PDF:
- Word to PDF — Creates a PDF document from Microsoft Word .docx
- JPG to PDF — Convert Images to PDF
- Split by pages — Split specific page ranges, or every page into a separate document.
Every tool works on a copy, so the original file is never touched. Uploads are stored under an unguessable id and deleted automatically two hours after you last open them; nothing is listed, shared or indexed. More on the security page.