Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To control how a web page looks when Chrome prints it or saves it as a PDF, add print-specific CSS: use @media print for document content and @page for paper size, orientation, and margins. In Chrome 131 and later, @page margin boxes can add author-defined headers, footers, and page numbers. These rules style the web page being printed; they do not edit an arbitrary PDF opened in Chrome.

What “PDF styling in Chrome” means

Chrome uses its print layout when you print a web page or create a PDF from it. CSS can change that output: print media rules can hide or restyle parts of the document, while page rules can describe the printed sheet and its margins. The same approach applies whether the result goes to a physical printer or is saved as a PDF.

This is not a way to reskin a PDF that already exists. If you open an existing PDF in Chrome’s PDF viewer, the page’s HTML and CSS are not being printed into a new document; the techniques here apply to web content that Chrome lays out for printing.

The two main mechanisms solve different problems:

  • @media print styles the document’s content for print, such as hiding navigation or other screen-only elements.
  • @page styles the page box, including its dimensions, orientation, and margins. In Chrome 131+, nested margin-box rules can put generated content in the page margins.

MDN describes the print media approach in its CSS printing guide. Its @page reference also cautions that browser support for individual parts of the syntax varies.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Epson EcoTank ET-2800 Wireless Color All-in-One Supertank Printer - Black
  • INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
  • COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
  • ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
  • HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs

How to set up print styles and page dimensions

Add the rules to the stylesheet for the page you intend to print. This example removes navigation and other screen-only content, sets A4 paper, and reserves margins around the document:

@media print {
  .site-nav,
  .screen-only {
    display: none !important;
  }
}

@page {
  size: A4;
  margin: 18mm 16mm 20mm;
}

Replace .site-nav and .screen-only with selectors that exist in your page. The declarations inside @media print apply to print layout rather than the normal screen view. The @page declaration specifies A4 paper and margins in top, left-and-right, and bottom order; choose dimensions that suit your document and intended paper.

Keep page-level settings in @page and content-level changes in @media print. That separation makes it easier to tell whether an unwanted result comes from the page geometry or from the content styling. After adding the CSS, open Chrome’s print preview and inspect the output before relying on the PDF.

How to add page numbers, headers, or footers

Chrome 131 introduced page margin boxes for printing and PDF output. They are nested inside an @page rule and let CSS supply generated content in the page margins. For example, the following places page numbers on the outer bottom corners of facing pages:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
@page :right {
  @bottom-right {
    content: "Page " counter(page);
    font-size: 9pt;
  }
}

@page :left {
  @bottom-left {
    content: "Page " counter(page);
    font-size: 9pt;
  }
}

The page counter represents the current page. To include the total page count as well, the pages counter represents the total number of pages; for example, the content could be "Page " counter(page) " of " counter(pages). Check the generated PDF to confirm that the text fits and appears where you expect.

Rank #2
Sale
Epson EcoTank Photo ET-8550 Wireless Wide-Format All-in-One Tank Printer
  • CARTRIDGE-FREE PRINTING — Print lab-quality photos, graphics and creative projects; Get vibrant colors and sharp text with Epson's high-accuracy printhead and Claria ET Premium 6-color inks
  • INK BOTTLES — Save on photos1 and creative projects with affordable in-house printing; All-in-one printer allows you to print 4" x 6" photos for about 4 cents each vs. 40 cents with traditional ink cartridges1
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; Printer, scanner and copier lets you print up to 6,200 color pages³
  • PRINT FOR LONGER — Up to 2 years of ink in the box² (and with every replacement ink set) for fewer out-of-ink frustrations with this wireless printer
  • ZERO CARTRIDGE WASTE — Epson EcoTank printer helps reduce the amount of cartridge waste ending up in landfills; Cartridge-free printer uses high-yield ink bottles; Each replacement ink bottle set is equivalent to about 100 individual ink cartridges⁴

The page-margin model defines 16 named margin boxes. The example uses @bottom-left and @bottom-right; other positions can be used for author-generated running matter. Chrome’s article on adding content to page margins when printing with CSS explains the feature and demonstrates generated content and the page counter.

The left/right page selectors in the example are useful when you want alternating placement. If you do not need that distinction, use an appropriate page-margin rule for the desired position and verify the result in preview. The CSS creates author-defined text; it does not guarantee that the text will fit every page or avoid all collisions with browser-added print elements.

How to print or save the result as a PDF

  1. Load the web page that includes your print stylesheet in Chrome.
  2. Open Chrome’s print dialog and inspect the preview. Check that screen-only elements are absent, the page size and margins look right, and any authored margin content is visible.
  3. If you want a file rather than a physical print, choose the PDF output option in the dialog and save the generated document.
  4. Open the saved PDF and inspect multiple pages, especially the first and last pages and any pages where the content length changes the pagination.

Do not assume the dialog’s own header and footer settings match your CSS. Chrome may add browser-generated header or footer text when there is room, even if the page has author-defined margin content. Turn off the browser-generated headers and footers in the print dialog if they duplicate or conflict with your design. Chrome’s documentation notes that its own headers and footers also will not appear when page margins are zero or too small to leave room; inspect the actual preview rather than relying on a rule of thumb.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Browser support and portability

Chrome for Developers says page-margin content is available starting with Chrome 131. The Chromium intent-to-ship announcement records the feature for desktop, Android, and WebView at milestone 131. That announcement documents the launch scope; it is not a guarantee for every downstream Chromium-based browser, embedded configuration, or older release. Check the actual browser and version where the page will be printed.

Do not treat support for @page as proof that every newer margin-box feature works in a given browser. Rachel Andrew’s Chrome for Developers article, dated October 30, 2024, says, “Chrome and Firefox support the @page at-rule.” That statement concerns the at-rule generally, not every part of its syntax. MDN likewise warns that not all browsers implement every part. If the same page must be printed in multiple engines, verify the specific rule and output in each one rather than promising portability from the basic @page support alone.

Rank #3
HP Smart Tank 5000 Wireless All-in-One Ink Tank Printer, Scanner, Copier with 2 Years of Ink Included, Best-for-Home, Cartridge-Free, Refillable and AI-Enabled. (5D1B6A)
  • SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
  • INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
  • KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
  • PREMIUM SUPPORT - Strong technical expertise to solve issues faster
  • THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.

For reference, the Chrome 131 launch record is available in the Chromium Blink intent-to-ship post. Use it to understand the feature’s launch scope, not as a compatibility matrix for every browser in use today.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting print-to-PDF output

Navigation or popups still appear

Confirm that the selectors in your @media print rule match elements in the page. A selector copied from an example will do nothing if the page uses a different class or structure. Inspect the print preview after changing the selectors.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The PDF has duplicate headers or footers

Check whether both the stylesheet and Chrome’s print dialog are adding content. Disable Chrome’s generated headers and footers when they overlap or duplicate your authored margin content, then inspect the preview again.

Page numbers are missing

First check that the page is being printed in Chrome 131 or later, where Chrome documents margin content support. Then check that the margin-box rule is nested inside @page, that its position is correct, and that the page has enough margin for the content. Feature support can differ in other browsers and configurations, so confirm the result in the browser that will produce the PDF.

The header or footer is clipped or overlaps page content

Review the @page margins and print preview. The page-margin content occupies margin space, so adjust the available margins or the placement and inspect the rendered pages. Also make sure the browser-generated headers and footers are not competing for the same space.

Rank #4
NDYIN Portable Printers Wireless for Travel, N80 Bluetooth Thermal Printer
  • Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
  • No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
  • Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
  • Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
  • The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art

The output looks different in another browser

Separate the basic print layout from newer page-margin features when diagnosing the difference. Verify the browser/version and the exact syntax in question; support for @page does not establish support for all its features. MDN’s @page reference is a useful reference point, but the final check is the actual output in the target browser.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The PDF does not match the screen design

That is the purpose of print-specific CSS: the print version can hide screen controls and use different page geometry. Decide which parts of the screen layout should remain, encode those choices in @media print, and review the resulting print preview rather than judging it from the screen view.

Or skip the browser setup

If your goal is to capture a web page rather than build a custom print stylesheet, ScreenshotNeo offers a screenshot API and MCP server. It can return a screenshot or PDF; it automates capture, not the CSS design decisions described above. Its cookie/consent handling can accept a banner as a visitor and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. AI agents can use its MCP server tools, including take_screenshot, get_page_info, and capture_pdf.

For a one-call screenshot example, see the ScreenshotNeo API documentation:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. The API can also return PDF, but this example saves a WebP screenshot. Sign up for ScreenshotNeo’s free plan to get started.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 3
HP Smart Tank 5000 Wireless All-in-One Ink Tank Printer, Scanner, Copier with 2 Years of Ink Included, Best-for-Home, Cartridge-Free, Refillable and AI-Enabled. (5D1B6A)
HP Smart Tank 5000 Wireless All-in-One Ink Tank Printer, Scanner, Copier with 2 Years of Ink Included, Best-for-Home, Cartridge-Free, Refillable and AI-Enabled. (5D1B6A)
PREMIUM SUPPORT - Strong technical expertise to solve issues faster; THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.
$194.03

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.