Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Use Puppeteer’s page.screenshot() when the report should be an image of a viewport, full page, clipped region, or element. Use page.pdf() when you need a paginated document with paper size, orientation, margins, or page ranges. One important distinction: PDFs use print CSS by default, so a report can look different from its browser view.
Choose by the deliverable
| Need | Use | Why |
|---|---|---|
| Preserve a visual state as an image | page.screenshot() |
Captures a viewport or full page, or a clipped area; image format and quality can be configured. Puppeteer screenshot API |
| Capture just one chart, card, or report section | elementHandle.screenshot() |
Captures an element and scrolls it into view if needed. Element screenshot API |
| Create a document for printing or sharing across pages | page.pdf() |
Supports paper format, landscape orientation, margins, page ranges, print backgrounds, and optional headers and footers. PDF options |
| Make a PDF follow screen CSS rather than print CSS | page.pdf() after selecting screen media |
Puppeteer selects print media by default; call page.emulateMediaType('screen') before generating the PDF. PDF API |
There is no universal speed, file-size, or quality winner established by the Puppeteer documentation. Choose based on whether the recipient needs an image or a paginated document, then verify the output against the intended screen or print styling.
Capture an HTML report as a screenshot
This example opens a report URL, waits for the page to load, and writes a full-page PNG. Install Puppeteer in your project with npm install puppeteer; Puppeteer’s browser installation behavior depends on the installed package and setup, so consult the installation guide if launch fails.
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' });
await page.screenshot({ path: 'report.png', fullPage: true });
} finally {
await browser.close();
}
})();
Replace the example URL with a report you are authorized to access. For a viewport-only image, omit fullPage: true. For a JPEG or WebP capture, specify type: 'jpeg' or type: 'webp'; quality applies to JPEG and WebP, not PNG. Screenshot option details are in the screenshot options reference.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problems#1 Best Overall
- 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)
Capture one element
const reportSection = await page.$('#report-summary');
if (!reportSection) throw new Error('Report section not found');
await reportSection.screenshot({ path: 'summary.png' });
The element screenshot method brings the target into view if necessary before capturing it. A missing selector should be handled explicitly rather than silently producing a different capture.
Generate a paginated PDF
Use page.pdf() when the report must fit a paper-oriented document workflow. This example writes a Letter PDF with backgrounds included:
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' });
await page.pdf({
path: 'report.pdf',
format: 'Letter',
printBackground: true,
margin: { top: '0.5in', right: '0.5in', bottom: '0.5in', left: '0.5in' }
});
} finally {
await browser.close();
}
})();
The PDF options reference documents Letter as the default format. Set options explicitly when reproducibility matters instead of relying on defaults that may be overlooked when the script is maintained.
Set orientation, page range, and CSS page sizing
await page.pdf({
path: 'report.pdf',
format: 'A4',
landscape: true,
pageRanges: '1-3',
preferCSSPageSize: true,
printBackground: true
});
pageRanges limits output to selected pages. preferCSSPageSize: true gives CSS @page sizing priority; by default, Puppeteer scales content to fit the selected paper size. The PDF options reference also documents margins, displayHeaderFooter, and waitForFonts (documented default: true, waiting for document.fonts.ready). See PDF options for supported values and details.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Rank #2
- Wireless 3-in-1: Print | Copy | Scan
- Print up to 30 Pages Per Minute (BW, Letter)
- First Print Out in Approximately 5.3 Seconds (Letter)
- Auto 2-sided Printing
- Uses Toner 071 / 071 High-Capacity Toner
Control screen and print styling
PDF generation uses the page’s print media styles by default. If the report’s screen layout is the one you want in the PDF, select screen media before calling page.pdf():
await page.emulateMediaType('screen');
await page.pdf({ path: 'report-screen-layout.pdf', printBackground: true });
Conversely, leave the default print media behavior in place when the report has deliberate print rules, such as page breaks or print-specific layout. Check the generated pages: selecting screen media changes which CSS rules apply, but it does not turn the PDF into a screenshot or remove pagination.
Preserve print colors when needed
Puppeteer notes that PDF colors are modified for printing by default. If matching the authored colors is important, apply print-color styling in the page’s CSS, such as -webkit-print-color-adjust: exact, and inspect the output. This is a styling choice to validate in your report, not a guarantee that every printer will render colors identically. See the PDF API documentation.
Choose capture scope and image options
- Viewport image: use
page.screenshot()withoutfullPageorclip. - Whole document image: set
fullPage: true; this remains one image, not a multi-page document. - Specific rectangle: pass a
clipregion to the screenshot call. - Single component: use
ElementHandle.screenshot()when a selector identifies the target. - Transparent output: screenshot options include
omitBackground; use it where a transparent image is required. - Format and quality: set the image type as needed; quality is not applicable to PNG.
These controls are documented in the screenshot options reference and the screenshot guide.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- FROM AMERICA'S MOST TRUSTED PRINTER BRAND – Perfect for small teams printing, scanning and copying professional-quality black & white documents and reports. Perfect for 1-3 people
- WORLD'S SMALLEST LASER IN ITS CLASS – Precision laser printing, scanning, and copying 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
- EASILY COPY ID CARDS AND MORE – Copy both sides of ID cards or other small-size documents onto the same side of one sheet of paper
Wait for the report to be ready
Navigation completion does not always mean a report’s data, charts, or images have finished rendering. Choose a wait condition that matches the page. Puppeteer’s goto() supports navigation wait conditions; for a report with a clear readiness marker, waiting for a selector is often more targeted than relying on an arbitrary delay.
await page.goto('https://example.com/report', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('#report-ready');
await page.screenshot({ path: 'report.png', fullPage: true });
Use the readiness selector only if the report actually exposes it. For fonts in PDF output, the documented waitForFonts default is true, but the page still needs to have loaded the content and styles the report requires.
Troubleshoot common output problems
The PDF layout differs from the browser
This is often expected: PDF generation uses print media by default. Add await page.emulateMediaType('screen') before page.pdf() if you intend to use screen CSS; otherwise, inspect and correct the report’s print styles.
PDF backgrounds or colors are missing
Set printBackground: true to include background graphics. Puppeteer also modifies PDF colors for printing by default; use print-color CSS when exact authored colors matter, then inspect the rendered PDF.
Rank #4
- FROM AMERICA'S MOST TRUSTED PRINTER BRAND – Perfect for offices printing, scanning and copying black & white brochures, business documents and presentations. Perfect for 1-5 people
- FASTEST TWO-SIDED PRINTING IN ITS CLASS – Up to 28 black-and-white pages per minute single-sided. Quickly finish multipage print projects with the fastest in-class two-sided printing speed
- DUAL-BAND WI-FI WITH SELF-RESET – Automatically detects and resolves connectivity issues
- STRONG SECURITY – Built-in security features help protect your printer from potential attacks
- PRINT FROM ANY DEVICE – Wireless printing from any mobile device, PC or tablet. Ethernet included. Works with Microsoft, Mac, AirPrint, Android, Chromebook and more.
The PDF has unexpected size or content scaling
Set format, orientation, and margins explicitly. If the report defines CSS @page dimensions, use preferCSSPageSize: true; otherwise Puppeteer scales content to fit the selected paper size.
An element screenshot is blank or fails
Confirm the selector matches an element before calling screenshot(). The element API scrolls a matching element into view if needed, but it cannot capture an element that was never found.
The image or PDF misses late-loading content
Wait for the report’s meaningful ready state, such as a known selector or completed data load, before capturing. A fixed delay can be unreliable when load times vary; tie the wait to the page’s actual rendering behavior where possible.
The script cannot launch a browser
Check the Puppeteer installation and browser setup for your environment against the installation guide. The appropriate remedy depends on how Puppeteer was installed and where the script runs.
Best Value
- FROM AMERICA'S MOST TRUSTED PRINTER BRAND – Perfect for small teams printing professional-quality black-and-white documents and reports. Print speeds up to 35 ppm black.
- PROFESSIONAL PRODUCTIVITY – Proficiency with every print—bring your business to life with toner designed for sharp, professional-quality prints
- UPGRADED FEATURES – Fast printing, scanning and copying, auto 2-sided printing, a 250-sheet input tray and 50-sheet auto document feeder
- AWARD-WINNING RELIABILITY – Performance you can count on page after page, and always ready for the high demands of business
- WIRELESS PRINTING – Stay connected with our most dependable Wi-Fi, which looks for the best connection to stay online
Or skip the browser setup
For a straightforward URL capture without managing Puppeteer and a local browser, ScreenshotNeo returns an image or PDF from one GET request. Its clean-shot steps accept cookie or consent banners and remove 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers identifying the page verdict and billing status. An MCP server provides screenshot tools for AI agents. Free includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.
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 parameters and response details. Sign up for 1,000 free screenshots a month, with no card required.
Performance, reliability, and cost considerations
The Puppeteer documentation cited here does not establish that screenshots or PDFs are universally faster, smaller, or more reliable. Actual results depend on the page, browser environment, content, and output settings; measure your own workload if those differences determine the implementation.
For recurring reports, make capture failures visible in your own job handling: wait for a meaningful page-ready condition, check that the target element exists when using a selector, and handle browser cleanup in a finally block. Puppeteer’s cited API documentation does not set a per-capture price; operational cost depends on the browser infrastructure and workload you run.
Frequently Asked Questions
Can Puppeteer make a PDF that uses screen CSS?
Yes. Call page.emulateMediaType('screen') before page.pdf().
Does fullPage: true create a multi-page PDF?
No. It makes a full-page image. Use page.pdf() for paginated output.
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.

