DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
Chromium

How to Control PDF Output Quality and Size with Puppeteer

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.

Direct answer: Puppeteer controls PDF appearance and pagination, but its documented page.pdf() options do not include a PDF-compression or image-downsampling switch. Treat quality and file size as separate goals: first make paper geometry, media styles, fonts, colors and breaks correct; then measure the resulting bytes and optimize the page inputs or post-process the PDF with a tool designed for compression.

What Puppeteer can—and cannot—control

page.pdf() renders a page into a PDF. By default, it uses the print CSS media type, waits for fonts, omits background graphics, and uses Letter paper unless you specify otherwise. These defaults affect visual output; none is documented as a file-size compressor.

The scale option changes rendering scale and accepts values from 0.1 through 2. A smaller value may alter pagination and readability, but Puppeteer does not describe it as compression and you should not assume it will produce a smaller file. Likewise, pageRanges limits which pages are emitted, rather than compressing the pages you keep.

For predictable results, hold the HTML, CSS, images, fonts and Chromium/Puppeteer version constant. Change one rendering input at a time, record byte count and page count, and inspect the PDF visually. The API documentation does not publish compression ratios or guaranteed size reductions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
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

Build a reliable baseline

Wait for content and fonts

Load the page, wait for the application’s data, and leave font waiting enabled. Puppeteer’s documented default for waitForFonts is true; disabling it can capture fallback fonts, change line wrapping and produce a different page count.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({headless: true});
const page = await browser.newPage();
await page.goto('https://example.com/report', {waitUntil: 'networkidle0'});
await page.waitForSelector('#report-ready');

await page.pdf({
  path: 'report-baseline.pdf',
  format: 'Letter',
  printBackground: false,
  waitForFonts: true
});

await browser.close();

Use an application-specific readiness marker when possible. networkidle0 alone can be unreliable on pages with analytics, streams or long polling.

Choose the intended media type

Without intervention, PDF generation uses print media. That lets @media print rules hide navigation, change colors or rearrange content. If the design was written for the screen and you deliberately want those styles, call:

await page.emulateMediaType('screen');
await page.pdf({path: 'screen-styled.pdf'});

Do this only when screen styling is the requirement. Printing can modify colors; CSS such as -webkit-print-color-adjust: exact can request more faithful colors, but that is a rendering decision, not a documented compression feature.

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

Paper geometry, margins and pagination

Format versus width and height

format defaults to Letter and takes precedence over width and height. Use a named format when you need a standard paper size:

await page.pdf({
  path: 'a4.pdf',
  format: 'A4',
  margin: {top: '16mm', right: '14mm', bottom: '16mm', left: '14mm'},
  printBackground: true
});

For a custom sheet, omit format and provide both dimensions:

await page.pdf({
  path: 'custom.pdf',
  width: '210mm',
  height: '297mm',
  margin: {top: '12mm', right: '12mm', bottom: '12mm', left: '12mm'}
});

Margins default to no margins. Set them explicitly so content does not move when a browser default or stylesheet changes.

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⁴

CSS @page and preferCSSPageSize

CSS can declare its own paper size:

<style>
@page { size: A4 portrait; margin: 16mm 14mm; }
@media print {
  .screen-only { display: none; }
  h1 { break-after: avoid; }
}
</style>

When preferCSSPageSize: true, the CSS @page size takes priority. When it is false (the default), content is scaled to fit the Puppeteer paper settings. Do not express conflicting geometry in both places unless you have a reason and test the result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.pdf({
  path: 'css-authoritative.pdf',
  format: 'A4',
  preferCSSPageSize: true,
  printBackground: true
});

Check for clipped content, unexpected whitespace and changed page breaks after every geometry change. A narrower page can increase pages even when the PDF bytes fall; a wider page can reduce pages while making text too small if you compensate with scale.

Visual-fidelity options that affect output

printBackground

The default is false. Enable it when colored panels, chart fills or background images are part of the intended design. Leaving it off can make a file visually smaller or simpler, but it is not a reliable size strategy and may destroy meaning.

scale

The default is 1; valid values are 0.1 to 2. Scale changes the rendered page, including apparent text size and pagination. Test readability at the final zoom and verify that headings, tables and images still fit.

await page.pdf({
  path: 'scaled.pdf',
  format: 'A4',
  scale: 0.9,
  printBackground: true
});

Fonts

Keep waitForFonts: true when typography matters. Confirm that the required font files are reachable in the capture environment and that the page has reached its ready state before generating the PDF. A fallback font can change line lengths, page count and the perceived quality even if the byte count is lower.

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

Tagged PDFs

The tagged option is documented as experimental, with a current default of true in the referenced API. Accessibility requirements should determine whether you change it. Do not toggle tagging merely to chase a smaller file without measuring accessibility and output differences.

A repeatable quality-and-size workflow

  1. Freeze the inputs. Use the same URL or HTML, data, fonts, image assets, viewport and Puppeteer/Chromium version for every run.
  2. Set paper geometry. Pick format or custom dimensions, define margins, and decide whether CSS or API dimensions are authoritative.
  3. Choose media deliberately. Use print media by default; call emulateMediaType('screen') only for a screen-styled deliverable.
  4. Capture a baseline. Save the PDF, measure its byte count and record page count.
  5. Change one input. Test one of backgrounds, scale, margins, page size, page ranges or stylesheet rules—not several at once.
  6. Inspect the result. Check text selection, font appearance, image sharpness, colors, links, table breaks, clipping and blank pages.
  7. Keep measured winners. Report the actual bytes and pages from your environment, including browser and Puppeteer versions. Do not generalize a result to every document.

A small Node.js measurement helper:

import {stat} from 'node:fs/promises';
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({headless: true});
const page = await browser.newPage();
await page.goto('https://example.com/report', {waitUntil: 'networkidle0'});
await page.pdf({path: 'measured.pdf', format: 'A4', printBackground: true});
await browser.close();

const {size} = await stat('measured.pdf');
console.log({bytes: size, kibibytes: size / 1024});

For actual compression, use a dedicated PDF optimizer after rendering, or reduce the source assets (for example, appropriately sized images) before capture. Keep the original PDF so an optimizer’s changes can be compared for text, images, colors and accessibility.

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.

Reducing size without damaging the document

Reduce source weight first

  • Serve images at the largest dimensions the PDF actually needs, not at an unnecessarily large web-resolution size.
  • Remove decorative backgrounds only when they are not required for interpretation or branding.
  • Ship only the font weights and character subsets used by the document, while preserving needed glyphs.
  • Hide nonessential UI, ads and duplicated content in print CSS.

These changes alter the page itself, so re-check pagination and visual hierarchy. Puppeteer does not promise that any particular asset change yields a specific byte reduction.

Emit fewer pages when appropriate

Use pageRanges when the consumer needs only selected pages:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.pdf({path: 'appendix-only.pdf', format: 'A4', pageRanges: '5-7'});

This is page selection, not compression. Confirm that the range syntax matches the generated page count.

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

Troubleshooting common failures

Print colors or backgrounds are missing

Cause: print CSS or the default printBackground: false. Fix by reviewing @media print, enabling printBackground when appropriate, and using -webkit-print-color-adjust: exact for elements whose colors must be preserved. Recheck ink-heavy designs for readability and size.

The PDF uses the wrong paper size

Cause: format overrides width/height, or CSS and API geometry conflict. Omit format for custom dimensions, or set preferCSSPageSize: true when @page is authoritative.

Text wraps differently or fonts look wrong

Cause: capture occurred before fonts loaded, a font request failed, or the installed browser differs. Keep waitForFonts enabled, wait for a readiness marker, verify font responses and pin the browser version used for comparisons.

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

Page count changes after a tiny edit

Cause: small changes in width, margin, scale, font metrics or line-height can move a break. Compare one variable at a time, use print-specific break rules, and inspect the boundary around the first changed page.

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 file is still large

Puppeteer has no documented compression switch. Measure whether large images, embedded fonts, backgrounds or simply a high page count dominate the file. Optimize those inputs or run the output through a PDF compressor, then compare quality and accessibility—not bytes alone.

The capture hangs

Cause: persistent network activity or an application that never reaches its ready state. Replace an unbounded wait with an explicit selector or application signal, set a navigation timeout, and ensure lazy content is triggered before calling page.pdf().

Or skip the browser setup

If your requirement is a clean website capture rather than controlling a local Puppeteer pipeline, ScreenshotNeo provides a single screenshot API request that returns PNG, JPEG, WebP or PDF. Its cleanup step accepts cookie-consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing result. An MCP server provides take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients.

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

Using the API requires no Puppeteer installation:

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

See the ScreenshotNeo documentation for PDF and rendering parameters. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up free.

Pricing and operational considerations

For a self-hosted Puppeteer service, account for Chromium memory, concurrency, browser startup time, fonts and asset bandwidth. Reuse a browser process where safe, isolate pages between jobs, set explicit timeouts and retain failed HTML or logs for diagnosis. If you use ScreenshotNeo, every feature is available on every plan: Free offers 1,000 shots/month, Starter is $5 for 3,000, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000 and Business $249 for 1,000,000; yearly billing gives two months free.

Frequently Asked Questions

Does Puppeteer have a quality setting for PDF images?

The documented PDF options reviewed do not provide an image-quality or downsampling control. Image dimensions and encoding come from the page assets and the PDF renderer.

Should I lower scale to compress a PDF?

No. scale changes rendering scale and can affect pagination and readability; any byte change must be measured for your document.

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

Which option controls PDF compression?

None of the documented page.pdf() options is a compression setting. Use measured source-asset changes or a separate PDF optimization tool.

Quick Recap

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 *

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.

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

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.