October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Commerce PDF Generation Explained: 6 Font and Print CSS Diagnostics

A practical checklist for finding why HTML invoices and receipts look different in generated PDFs, from font readiness and print media to page size and pagination.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If an invoice looks right in the browser but wrong as a PDF, check the rendering conditions before rewriting the layout: font readiness, print media, page-size precedence, color handling, page breaks, and header/footer settings. Browser PDF APIs can use print styles and renderer-specific options, so validate the generated file with the browser and version your application actually deploys.

1. Why do fonts look different in my generated PDF?

First check whether the intended font loaded and whether your PDF capture waits for fonts. Puppeteer documents that Page.pdf() waits for fonts by default; its waitForFonts PDF option waits for document.fonts.ready and defaults to true. Confirm the deployed call has not overridden that option, then inspect the page’s loaded fonts and the resulting PDF. These are documented Puppeteer behaviors, not a guarantee for every renderer or configuration.

See the Puppeteer PDF generation guide and the Puppeteer PDFOptions reference (which documents version 25.12.0).

2. Why does my PDF ignore print CSS?

A browser view is not necessarily the right comparison: Puppeteer and Playwright both document print media as the default for PDF generation. Check the CSS under @media print and establish which media the renderer is using. If the intended output should match screen styling, both APIs document a way to emulate screen media; configure that deliberately rather than assuming the PDF uses screen styles.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Brother DCP-L2640DW Wireless Compact Monochrome Multi-Function Printer, Copy, Scan, Duplex, Mobile Printing
  • BEST FOR SMALL BUSINESSES – Engineered for extraordinary productivity, the Brother DCP-L2640DW Monochrome (Black & White) 3-in-1 combines laser printer, scanner, copier in one compact footprint and delivers high-quality black & white prints
  • FAST PRINTER WITH EFFICIENT SCANNING – Produces documents quickly with print speeds up to 36 ppm(2) and scan speeds up to 23.6/7.9 ipm(3) (black/color). A 50-page auto document feeder(4) allows for convenient, time saving multi-page scanning and copying
  • FLEXIBLE CONNECTION OPTIONS – Easily navigate the changing demands of your business with secure multi-device connectivity via built-in dual-band wireless (2.4GHz / 5GHz) and Ethernet. Or connect locally to a single computer via USB interface
  • BROTHER MOBILE CONNECT APP – Print, scan, and manage your wireless printer anytime, from almost anywhere from your mobile device. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(5)
  • CHOOSE BROTHER GENUINE TONER – When it’s time to replace your toner, be sure to choose Brother Genuine TN830 or TN830XL replacement toner. And with Refresh EZ Print Subscription Service, you’ll never worry about running out of toner again and you’ll enjoy savings of up to 50%(6) on Brother Genuine Toner. Get started with Refresh today with a Free Trial(1)

Consult the Puppeteer PDF guide and the Playwright Page API. Verify the relevant API and option names against the version deployed.

3. How do I keep the PDF page size consistent?

Compare the CSS @page size with the paper dimensions or format passed to the PDF API. In Puppeteer, preferCSSPageSize controls which takes precedence: when enabled, CSS page size takes priority over API width, height, or format. Its documented default is false, in which case content is scaled to fit the selected paper size. Puppeteer’s reference also says unspecified margins default to none.

Rank #2
Brother HL-L2405W Wireless Compact Monochrome Laser Printer with Mobile Printing, Black & White Output | Includes Refresh Subscription Trial(1), Works with Alexa
  • BEST FOR HOMES & HOME OFFICES – Engineered for consistent, premium print quality, the Brother HL-L2405W Monochrome (Black & White) Laser Printer delivers sharp, crisp prints at an affordable price. Prints one-sided documents at speeds up to 30ppm(2)
  • COMPACT, CONNECTED PRINTER – Flexible connection options make this an ideal printer for home use and at-home offices. Securely connect to multiple devices with built-in dual-band wireless (2.4GHz/5GHz) or locally to a single computer via USB interface
  • BROTHER MOBILE CONNECT APP – Manage your printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
  • VERSATILE PAPER HANDLING – Enjoy seamless, reliable everyday printing with the 250-sheet paper tray(4) and a manual feed slot that enables printing on envelopes and specialty pape
  • BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer

If pages are unexpectedly scaled or content is clipped, inspect both sources of page-size settings and the option value in the actual capture call. The behavior above is documented in the Puppeteer PDFOptions reference; check the reference for your deployed version.

4. Why are colors or backgrounds missing from my PDF?

Color adjustment and background printing are separate settings. Playwright says PDF colors are modified for printing by default and points to -webkit-print-color-adjust when exact rendering is needed. Puppeteer separately exposes printBackground, which defaults to false. For missing brand fills or shifted colors, check both the renderer’s color behavior and whether background printing is enabled, then inspect the saved PDF rather than relying on the browser preview.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Canon imageCLASS LBP6030w - Monochrome Single-Function Wireless Compact Wireless Laser Printer, 1 Year Limited Warranty, 19 PPM, White - Print Only
  • FAST PRINT SPEEDS: Print up to 19 pages per minute.
  • COMPACT DESIGN: Space-saving, compact design fits anywhere in your home, school or small office.
  • WIRELESS CONNECTIVITY: Print from almost anywhere in your workspace using your compatible mobile device.
  • PAPER CAPACITY: Up to 150 sheets.
  • SUSTAINABILITY: Uses less than 2 watts in Energy Saver mode.

These behaviors are documented in the Playwright Page API and the Puppeteer PDFOptions reference. The settings are not interchangeable: enabling background printing does not, by itself, establish that print color adjustment is disabled.

5. Why are invoice rows splitting across pages?

Test page breaks with data that resembles actual commerce documents. A short demo invoice may not reveal problems that appear when descriptions wrap, addresses are long, or totals land close to a page boundary.

Rank #4
Brother HL-L2460DW Wireless Compact Monochrome Laser Printer with Duplex, Mobile Printing, Black & White Output | Includes Refresh Subscription Trial(1), Works with Alexa
  • BEST FOR HOME OFFICES & SMALL TEAMS – Engineered for consistent, premium print quality, the Brother HL-L2460DW Monochrome (Black & White) Laser Printer produces documents that are clear, crisp, and easy to review and share, all at an affordable price
  • COMPACT, CONNECTED, EXCEPTIONALLY EFFICIENT– Connect with built-in dual-band wireless (2.4GHz/5GHz), Ethernet, or to a single computer via USB interface. Prints at speeds up to 36ppm(2), plus automatic duplex printing saves time and reduces paper waste
  • BROTHER MOBILE CONNECT APP – Manage your wireless printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
  • VERSATILE PAPER HANDLING – Tackle high-volume black & white printing with the 250-sheet capacity paper tray.(4) The manual feed slot enables printing on envelopes and specialty paper
  • BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer
  1. Generate a document with long product descriptions and enough line items to span multiple pages.
  2. Add long billing or shipping addresses and vary the amount of wrapping.
  3. Place the totals near a page boundary in at least one example.
  4. Inspect the resulting PDF for split rows, overflow, and unusually large gaps.
  5. Validate any CSS page-break changes in the target browser and deployed version.

This is a diagnostic test procedure, not a claim that one CSS rule guarantees the same pagination in every renderer. Universal page-break rules are not established here, so test the output you ship.

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

6. Why are headers or footers missing?

In Puppeteer, check whether displayHeaderFooter is enabled and whether the header and footer templates contain the expected content, such as a date, title, or page number. The API exposes these controls separately; a template does not ensure that headers and footers are displayed if the feature is not enabled. Confirm the option names and behavior in the PDFOptions reference for your deployed version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
HP LaserJet M110w Wireless Black & White Printer, Print, Fast speeds, Easy Setup, Mobile Printing, Best-for-Small Teams
  • FROM AMERICA'S MOST TRUSTED PRINTER BRAND – Perfect for small teams printing professional-quality black & white documents and reports. Perfect for 1-3 people
  • WORLD'S SMALLEST LASER IN ITS CLASS – Precision laser printing that fits anywhere
  • FAST PRINT SPEEDS – Up to 21 black-and-white pages per minute single-sided
  • WIRELESS WITH SELF-RESET – Helps you stay connected
  • PRINT FROM ANY DEVICE – Wireless printing from any mobile device, PC or tablet. Works with Microsoft, Mac, AirPrint, Android, Chromebook and more

Keep a renderer-specific PDF checklist

Record the browser automation library and version alongside the PDF options used by the production capture. For each representative invoice or receipt, check:

  • Whether the intended fonts are loaded before capture and whether font waiting is enabled where supported.
  • Whether the PDF uses print media or intentionally emulates screen media.
  • Which page-size source wins and whether the output is being scaled.
  • Whether print color adjustment and background printing produce the intended result.
  • How realistic long documents paginate.
  • Whether header/footer display and template content are both configured when needed.

Keep generated PDFs as test artifacts when changing the renderer, its version, or print-related CSS. A browser screenshot or screen preview does not show all the settings that can affect the saved document.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.