What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Put the full printable area in a wrapper, constrain the report inside it, and center that narrower child with margin-inline: auto (or center its children with flexbox). Then choose one authority for paper size: either CSS @page with preferCSSPageSize: true, or Puppeteer’s format/width/height options. This prevents the left shift, clipping, and unexpected scaling that make landscape PDFs appear off-center.

The layout pattern that centers reliably

A full-width element already occupies all available horizontal space, so it cannot be moved left or right by auto margins. Give the page a full-width wrapper, then give the report a maximum width and auto side margins.

<div class='page'>
  <main class='content'>
    <h1>Quarterly report</h1>
    <p>The report remains centered on a wide landscape sheet.</p>
  </main>
</div>
@page {
  size: A4 landscape;
  margin: 12mm;
}

html,
body {
  margin: 0;
  padding: 0;
}

.page {
  width: 100%;
}

.content {
  width: min(100%, 1100px);
  margin-inline: auto;
  box-sizing: border-box;
}

/* Center a row that must span the printable width. */
.full-width-row {
  width: 100%;
  display: flex;
  justify-content: center;
}

The @page margin defines the printable inset. Inside that area, .page fills the width and .content becomes narrower when the sheet is wider than 1100 pixels. The browser can then distribute the spare space equally on both sides.

What each centering property actually does

  • margin-inline: auto centers a block whose width is less than its containing block. Use box-sizing: border-box when padding or borders are included in the declared width.
  • display: flex; justify-content: center centers children along the flex container’s main (horizontal, by default) axis. It is useful for a full-width row containing a narrower panel.
  • text-align: center centers text and other inline content; it does not move the containing element’s box.
  • Resetting html and body margins removes the browser’s default offset before PDF margins are applied.

Make landscape orientation and page size agree

Puppeteer generates PDFs with the CSS print media type. Print-only rules therefore belong in your normal stylesheet or in an @media print block. If you need the screen stylesheet instead, call page.emulateMediaType('screen') before page.pdf().

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)

Puppeteer exposes landscape, format, width, height, margins, and preferCSSPageSize. The last option determines whether a CSS @page size takes priority over Puppeteer’s paper-size settings.

Source of truth CSS Puppeteer When to use it
Paper dimensions and margins @page { size: A4 landscape; margin: 12mm; } landscape: true plus optional format or dimensions Use CSS when print styling must match other print engines.
Priority switch CSS size is honored only when selected preferCSSPageSize: true Set this when @page is your authority.
Alternative authority Omit a competing @page size format: 'letter', or explicit width/height Use this when the Node script centrally controls paper dimensions.

Do not silently mix an A4 CSS rule with a Puppeteer Letter format and expect the same scale. Pick one authority, document it, and keep the wrapper relative to the resulting printable width.

Configuration A: CSS controls the paper

@page {
  size: Letter landscape;
  margin: 0.5in;
}
await page.pdf({
  path: 'out.pdf',
  landscape: true,
  printBackground: true,
  preferCSSPageSize: true
});

Here, CSS defines the paper and margins. The explicit landscape flag documents the intended orientation, while preferCSSPageSize gives the @page rule priority.

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

Configuration B: Puppeteer controls the paper

await page.pdf({
  path: 'out.pdf',
  format: 'letter',
  landscape: true,
  margin: {
    top: '0.5in',
    right: '0.5in',
    bottom: '0.5in',
    left: '0.5in'
  },
  printBackground: true
});

With this approach, remove an @page size that could contradict the script, or leave it limited to rules that do not redefine paper dimensions. Your CSS wrapper should use percentages and max-width, not a fixed width wider than the selected printable area.

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

A complete Puppeteer implementation

Install Puppeteer in a Node.js project, serve the page you want to print, and replace the example URL with your report route.

npm install puppeteer
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com/report', {
      waitUntil: 'networkidle0'
    });

    // Wait for web fonts because they can change line wrapping and height.
    await page.evaluate(async () => {
      await document.fonts.ready;
    });

    await page.pdf({
      path: 'report.pdf',
      landscape: true,
      printBackground: true,
      preferCSSPageSize: true
    });
  } finally {
    await browser.close();
  }
})();

The page is printed with the print media type by default, so the CSS in the first example is active. If you intentionally want screen media instead, add await page.emulateMediaType('screen') immediately before page.pdf() and verify that the screen layout has the same widths and print margins.

Rank #3
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.

Centering a full-width row without centering its text

<div class='full-width-row'>
  <section class='panel'>
    <p>This panel is centered, but its text remains left aligned.</p>
  </section>
</div>

<style>
.full-width-row {
  width: 100%;
  display: flex;
  justify-content: center;
}

.panel {
  width: min(100%, 900px);
  text-align: left;
}
</style>

Use this pattern for dashboards, cover pages, or a report section that must span the printable row while keeping the actual panel narrower.

Prevent margins, overflow, and scaling from creating a false offset

  • Account for both kinds of margins. CSS @page margins and Puppeteer’s margin option affect the printable rectangle. Applying both deliberately is fine; applying both accidentally reduces the available width twice.
  • Inspect computed widths. If the wrapper and child are both width: 100%, there is no spare space for auto margins to distribute.
  • Keep wide tables, images, and transformed elements inside the printable width. A child wider than that area cannot look centered without clipping or scaling.
  • Use box-sizing: border-box on constrained containers so padding does not make their outer width exceed the declared value.
  • Load fonts and images before printing when their dimensions affect line breaks. The example waits for fonts; add targeted image readiness checks for reports whose layout depends on remote images.
  • Inspect the generated PDF, not only the browser viewport. PDF pagination uses print layout, page margins, and the selected paper size.

Or skip the browser setup

ScreenshotNeo provides a website capture API and MCP server when you need a rendered page without maintaining a local Chromium script. Its API can return PNG, JPEG, WebP, or PDF; the same endpoint accepts the URL and capture options. The documentation is at https://screenshotneo.com/docs/.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Before capture, ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 shots each month with no card; paid plans start at $5 for 3,000 shots. Create the free account.

Troubleshooting

The landscape PDF is shifted left

First inspect html and body margins. Next confirm that the centered child has a constrained width. Finally compare @page with Puppeteer’s format, width, and height. A conflicting size rule or a child wider than the printable rectangle is more likely than a failure of margin-inline: auto.

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

margin: auto does nothing

Auto margins need unused inline space. Add a width or max-width to the child, or use a flex parent to center its contents. If you need centered text rather than a centered box, use text-align: center.

The PDF ignores my print CSS

page.pdf() uses print media. Put the rules in the regular stylesheet or an @media print block. If you called emulateMediaType('screen'), remove that call or move print-specific rules into the screen stylesheet.

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

The content is clipped or scaled unexpectedly

Check fixed pixel widths, large images, tables, transforms, and horizontal padding. Reduce the child’s maximum width, allow tables to reflow, or choose a paper size with a larger printable area. Also verify that margins have not been declared both in CSS and in Puppeteer unintentionally.

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

Text wraps differently between runs

Wait for web fonts and layout-dependent images before calling page.pdf(). A late font swap can change line lengths and push content onto another page.

The script hangs while loading

networkidle0 waits for network activity to become idle. Pages with analytics, live updates, or long polling may never reach that state. Use an earlier navigation milestone and then wait for the specific selector, font, or image your report requires.

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

Performance and repeatability checklist

  • Reuse a browser process for batches of PDFs and create a fresh page per document; launching Chromium for every page adds avoidable startup work.
  • Set a deliberate viewport before navigation when responsive breakpoints affect the report’s width.
  • Prefer one page-size authority so a Chromium upgrade cannot expose a hidden CSS-versus-option conflict.
  • Wait only for resources that affect layout. Waiting indefinitely for third-party requests reduces reliability.
  • Keep capture output and temporary files on a predictable path, and always close the browser in a finally block.
  • For very wide data, decide whether reflow, clipping, or a larger paper size is acceptable before adding more centering rules; centering cannot fix content that does not fit.

The dependable result is a constrained child centered inside a full-width printable wrapper, with orientation and margins controlled by one clearly selected sizing authority.

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

Frequently Asked Questions

Can I keep a centered panel while keeping all of its text left aligned?

Yes. Center the panel with auto margins or a flex row, then set text-align: left on the panel itself. Box alignment and text alignment are independent.

What should happen when a table is wider than the landscape page?

Choose a policy explicitly: let the table reflow, reduce its width, or select a larger printable paper size. A centering rule cannot make an oversized child fit without clipping or scaling.

Why can two PDFs from the same HTML have different line breaks?

Fonts or layout-dependent images may not have finished loading when printing starts. Wait for those resources before calling page.pdf(), and keep the viewport and page-size authority consistent.

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.

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