Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk5 min

Puppeteer Screenshot vs. PDF for an HTML Report: Which Should You Choose?

Choose Puppeteer screenshots for image captures and PDFs for paginated reports. See examples for full-page and element images, PDF options, media modes, and color styling.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Puppeteer’s page.screenshot() when you need an image of a report, and page.pdf() when you need a paginated document for sharing or printing. The key difference is that PDF generation uses print CSS by default, so its layout may differ from the page on screen. You can select screen CSS before generating the PDF when that is the layout you need.

Choose based on the report you need to deliver

Need Start with Why
Show a particular visual state as an image page.screenshot() Capture the viewport, the full page, or a clipped region; choose an image format and, where supported, quality.
Capture one report component ElementHandle.screenshot() Captures a selected element, scrolling it into view if needed.
Create a multi-page report for printing or document sharing page.pdf() Configure paper size, orientation, margins, page ranges, and optional headers or footers.
Make a PDF follow the page’s screen styling page.pdf() after selecting screen media Puppeteer uses print media by default; selecting screen media first changes which CSS rules apply.

These outputs are not interchangeable: a screenshot is an image capture, while a PDF is a paginated document. Choose the format that matches how the report will be viewed or used.

As an Amazon Associate I earn from qualifying purchases.

Capture a report as an image

Use page.screenshot() for a viewport or full-page image, or page.screenshot({clip: ...}) for a specific rectangle. For a particular component, use the element’s screenshot method. Puppeteer’s screenshot options include fullPage, clip, type, quality, and omitBackground. Quality does not apply to PNG.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const image = await page.screenshot({
  path: 'report.png',
  fullPage: true,
  type: 'png',
});

For an element image, select the element and call its screenshot method:

#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)
const reportSection = await page.$('#report-summary');
if (!reportSection) throw new Error('Report section not found');
await reportSection.screenshot({ path: 'report-summary.png' });

The element screenshot method scrolls the element into view if necessary, then captures it using the page screenshot mechanism. If your goal is a transparent image, omitBackground is available; check the page’s visual result and selected image format for your use case.

Generate a paginated PDF

page.pdf() produces a PDF using print CSS by default. Configure document properties through its options, including paper format, landscape orientation, margins, page ranges, print backgrounds, and optional headers and footers.

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
await page.pdf({
  path: 'report.pdf',
  format: 'A4',
  printBackground: true,
  margin: {
    top: '16mm',
    right: '14mm',
    bottom: '16mm',
    left: '14mm',
  },
});

The documented default paper format is Letter. Set format explicitly if the report must use another paper size. Use landscape: true for a landscape page, pageRanges to limit the output to selected pages, or displayHeaderFooter to enable print headers and footers. preferCSSPageSize gives CSS @page sizing priority; otherwise, Puppeteer scales content to fit the selected paper size. The PDF options documentation says waitForFonts defaults to true and waits for document.fonts.ready.

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.

Control screen and print styling

Keep the default print layout

Leave the page in its default media mode when the PDF should follow print-specific CSS. This may change the report compared with its on-screen appearance. Review the page’s @media print rules and @page sizing if elements move, disappear, or paginate unexpectedly.

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.

Use screen CSS in the PDF

If the PDF should reflect screen media rules, call page.emulateMediaType('screen') before page.pdf():

await page.emulateMediaType('screen');
await page.pdf({ path: 'report-screen-style.pdf', format: 'A4' });

Preserve print colors when needed

Puppeteer notes that PDF colors are modified for printing by default. If exact colors matter, apply -webkit-print-color-adjust in the report’s CSS, for example:

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
@media print {
  .report {
    -webkit-print-color-adjust: exact;
  }
}

Use this when print color fidelity is important, and check the generated document because the PDF’s print styling and pagination still govern its final appearance.

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

Wait for the report before capturing

Both methods capture the page as it exists when the capture runs. Navigate to the report and wait for its content to be ready before calling either API. If the report depends on asynchronous data or images, make your application’s readiness condition explicit rather than assuming navigation alone means the finished report is visible.

Best Value
HP LaserJet M110w | Monochrome | Laser Printer | Fast Black-and-White Printing | Mobile Printing | Wireless Printing | Fast Printing
  • 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
  1. Open the report page in the Puppeteer page.
  2. Wait for the report’s relevant content or application-specific ready state.
  3. For a PDF, choose print or screen media and set paper and pagination options.
  4. Call page.screenshot(), an element screenshot method, or page.pdf() according to the intended output.
  5. Inspect the resulting file for clipped content, missing styling, unexpected page breaks, or incomplete assets.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common output problems

  • The PDF looks different from the browser: PDF generation uses print media by default. Keep print styling if that is intentional; otherwise, select screen media with page.emulateMediaType('screen') before calling page.pdf().
  • Colors look muted or missing in the PDF: print color adjustment may modify colors. Add -webkit-print-color-adjust: exact where appropriate and inspect the generated PDF.
  • The PDF uses the wrong paper size or scales content: choose format explicitly, and check preferCSSPageSize if the page’s CSS @page dimensions should take priority.
  • A screenshot captures the wrong area: use fullPage for the full page, clip for a rectangle, or an element screenshot for a component.
  • The image is missing a transparent background: check the omitBackground option and the chosen image format.
  • Content or fonts are incomplete: ensure the report has reached its ready state before capture. PDF font waiting is enabled by default in the documented options, where waitForFonts waits for document.fonts.ready.

Performance, reliability, and cost

The official Puppeteer documentation cited here does not establish a universal speed, file-size, or quality winner between screenshot and PDF. Output size and capture time depend on the page, assets, and settings; measure your own report workload if those constraints matter. For reliable results, make the capture wait for report readiness and verify representative outputs, especially where print CSS, fonts, page breaks, or large full-page captures are involved.

Or skip the browser setup

ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. A request can return a PNG, JPEG, WebP, or PDF. For example, this cURL call saves a WebP screenshot of a report URL:

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

See the ScreenshotNeo API documentation for request options. Cookie and consent banners are accepted and removed before capture, along with supported newsletter popups and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. The 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.

The free plan includes 1,000 screenshots per month with no card required. Paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo’s free plan.

Sources and version notes

Puppeteer’s screenshot, element screenshot, PDF, and PDF-options documentation describes the APIs and defaults discussed above. The API pages were surfaced with version 25.12.0 labels, while the Page.pdf() documentation is on the /next/ path. Check the documentation for the Puppeteer version installed in your project before relying on version-specific behavior.

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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
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.