How to export HTML to PDF as one page

Print scaling handles a small overflow. A custom @page size handles a page that was never meant to be paper shaped. Choose by how far over you are.

The quickest route to an HTML to PDF one page export is the scale control in the print dialog. If the preview shows two pages, dropping to 80 or 70 percent usually collapses it to one without hurting readability.

That is the whole answer when you are slightly over. The rest of this page is for when you are a long way over, which is common with dashboards and one pagers built for a screen.

The print preview showing a page count, before any setting is changed.
The print preview showing a page count, before any setting is changed.

HTML to PDF one page: pick a route by how far over you are

Preview shows Route Cost
Two pages, a few lines spilling Lower the scale Slightly smaller text
Two pages, wide content Switch to landscape Different shape
Three or four pages Cut content, then scale Editorial work
A long scrolling page Custom @page height Not printable on real paper
Anything, and text does not matter Export as an image No selectable text, no links

Read the count before you touch anything. People change five settings at once and then cannot tell which one helped.

Route 1: scale

The print dialog has a scale field, usually under More settings. Set a number rather than using Fit to printable area, so you know what happened.

Work down in steps of ten and watch the preview. Stop when it shows one page.

The floor is readability. Below roughly 60 percent, body text is uncomfortable and small print in tables becomes guesswork. If you need less than that, scaling is not your tool.

Note that scaling shrinks everything uniformly, including the margins, so a page that was tight at 100 percent gains a little room as it shrinks.

Set the margins to None before you start lowering the scale. Recovering the default margin often buys enough room that no scaling is needed at all.

Scaling also affects images. A chart drawn as SVG stays sharp at any scale, while a bitmap screenshot pasted into the page gets softer as it shrinks.

Route 2: a custom page size

PDF does not require A4. You can declare a sheet of any dimensions, and Chrome honours it when printing.

@page {
  size: 210mm 900mm;
  margin: 10mm;
}

That is a sheet the width of A4 and roughly four times as tall. A long report lands on it as one continuous page.

Measure before you guess. Set the height a little above the rendered height of the content, then check the preview for a trailing blank sheet.

A PDF opened at a custom tall page size, one continuous sheet rather than four.
A PDF opened at a custom tall page size, one continuous sheet rather than four.

The tradeoff is real. A 900mm sheet reads well on a screen and cannot be printed on an office printer without scaling it down to illegibility. Use it when the destination is a file someone opens, not paper.

Route 3: make the content shorter

Less popular, usually correct. A one pager that needs 40 percent scaling is not a one pager.

  • Hide anything that exists for navigation. A print stylesheet with display: none on the nav and sidebar often recovers a quarter of the height.
  • Collapse the gaps. Generous screen spacing translates into wasted paper.
  • Drop the second chart. Two charts at half size communicate less than one at full size.
  • Move detail into an appendix page and stop pretending it fits.
@media print {
  .nav, .sidebar, .footer, .no-print { display: none; }
  section { margin-block: 8mm; }
  h1 { font-size: 20pt; }
}

Print stylesheets covers the full set of rules. Exporting without losing formatting covers the colour and page break problems you will hit at the same time.

Stop the page breaking in the wrong place

Even at one page, an element positioned near the boundary can push the whole thing over. Two rules prevent it.

@media print {
  table, figure, .card { break-inside: avoid; }
  .page-break { break-before: page; }
}

The first keeps blocks whole. The second gives you a deliberate break if you decide two pages is the honest answer after all.

When an image is the better answer

If the deliverable is a picture of a dashboard for a slide or a chat message, a PDF is doing nothing for you.

HTML to image captures the full page, including the part below the fold, as one file. It always lands as one image, which is the property you were chasing.

You give up selectable text, working links and search. For a chart nobody will quote from, that is no loss.

The same page as a full page capture and as a one page PDF, side by side.
The same page as a full page capture and as a one page PDF, side by side.

The version that does not need to fit

Worth saying plainly, because it removes the problem rather than solving it. The reason a page has to fit on one sheet is usually that it is being sent as a file.

Paste the HTML into a NOS document and it renders as a page with its own address. Share, then Share link, then Create link. A page has no page count, so nothing needs to be shrunk.

Send the link for reading, and keep the PDF for the archive copy that has to sit in a folder. Turning HTML into a link is that step, and PDF versus a live page is the comparison in full.

Questions people ask

How do I force an HTML page onto a single PDF page?

If you are slightly over, lower the scale in the print dialog until the preview shows one page. If you are far over, define a custom page size in CSS with @page so the sheet itself is as tall as the content. Chrome honours a custom size.

What scale is too small to read?

Below about 60 percent body text gets uncomfortable on screen and hard to read on paper. If you need less than that, the content does not fit and scaling is the wrong tool. Cut content, switch to landscape, or use a taller custom page.

Can a PDF page be longer than A4?

Yes. PDF page size is arbitrary. A single sheet 210mm wide and 900mm tall is valid and opens fine in every reader. It scrolls rather than paginating, which suits a dashboard and is unusable if someone has to print it.

Should I use an image instead?

If nobody will select the text or click the links, a full page image is simpler and always lands on one page. You lose searchable text and working links, which is a real cost for anything that gets referenced later.

Keep reading