PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchUse Puppeteer’s page.pdf() method: launch Puppeteer’s bundled browser, navigate to the page, wait for the content your PDF needs, then save the generated PDF. Puppeteer uses print CSS by default; call page.emulateMediaType('screen') first if you want the screen layout instead. The examples below make the key output choices explicit rather than relying on defaults.
Generate a PDF with Puppeteer
Install Puppeteer in your Node.js project, then save this as an ES module file such as capture.mjs. Replace the example URL as needed.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle2' });
await page.pdf({
path: 'page.pdf',
format: 'A4',
printBackground: true,
preferCSSPageSize: true,
});
} finally {
await browser.close();
}
This follows Puppeteer’s PDF generation guide: launch a browser, create a page, navigate, and call page.pdf(). The example uses networkidle2, but no single navigation wait guarantees that every page’s content is ready. For a site that renders important content after navigation, wait for the relevant selector or application-specific readiness condition before creating the PDF.
puppeteer.launch()starts the browser;browser.newPage()creates a page to print.page.goto()navigates to the target. Puppeteer’s general wait option defaults to theloadlifecycle event; this example explicitly asks fornetworkidle2. See the WaitForOptions reference.page.pdf()writes the PDF topage.pdfbecause a path is supplied.- The
finallyblock closes the browser even if navigation or PDF generation throws an error.
Wait for the right content before printing
Navigation completing and page content being ready are not always the same thing. A page may render data after an API call, load images lazily as the page is scrolled, or keep network activity open through polling. Choose a readiness condition that matches the content you need; use an explicit selector or application condition when the PDF depends on a particular element.
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
- PORTABLE SCANNER FOR USE ON-THE-GO — The fastest and lightest mobile single-sheet-fed compact document scanner in its class¹
- QUICK DOCUMENT SCANNING ― This Epson ultra-fast scanner scans a single page as quickly as 5.5 seconds²; Windows and Mac compatible
- VERSATILE PAPER HANDLING ― Portable scanner scans documents up to 8.5 x 72 in; Also easily digitizes receipts and ID cards to make accounting, bookkeeping, and organizing simpler
- INTUITIVE, HIGH-SPEED SOFTWARE — Epson ScanSmart Software³ is a smart tool allowing you to easily scan, review, and save; Stay organized easily with the help of this Epson scanner
- EASY SETUP — USB-powered connect to your computer for quick and simple scanning; No batteries or external power supply required to operate portable document scanner; Standard Connectivity: USB 2.0
Wait for a selector
For a known element that appears when the printable content is ready, wait for it after navigation:
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('#report-content');
await page.pdf({ path: 'report.pdf', format: 'A4', printBackground: true });
Replace #report-content with a selector that exists on the target page. A selector only establishes readiness for the element you chose; it does not prove that unrelated content, images, or fonts have finished loading.
Wait for network activity to settle
Puppeteer also provides page.waitForNetworkIdle(). Its documented behavior includes waiting at least the configured idle time; it can be useful for pages whose content is driven by requests, but ongoing polling or other background traffic can make network-idle waits unsuitable. See the Page API reference.
Use networkidle2 or a network-idle wait as a page-specific choice, not as a universal signal that a site is fully rendered. For pages that never become idle, wait for the content you actually need instead.
Rank #2
- FAST SPEEDS - Scans color and black and white documents a blazing speed up to 16ppm (1). Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
- ULTRA COMPACT – At less than 1 foot in length and only about 1. 5lbs in weight you can fit this device virtually anywhere (a bag, a purse, even a pocket).
- READY WHENEVER YOU ARE – The DS-640 mobile scanner is powered via an included micro USB 3. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan.
- WORKS YOUR WAY – Use the Brother free iPrint&Scan desktop app for scanning to multiple “Scan-to” destinations like PC, Network, cloud services, Email and OCR. (2) Supports Windows, Mac and Linux and TWAIN/WIA for PC/ICA for Mac/SANE drivers. (3)
- OPTIMIZE IMAGES AND TEXT – Automatic color detection/adjustment, image rotation (PC only), bleed through prevention/background removal, text enhancement, color drop to enhance scans. Software suite includes document management and OCR software. (4)
Choose print CSS or screen CSS
page.pdf() renders using the print CSS media type. That means print-specific rules, such as @media print and @page, can affect layout. To render with the screen stylesheet, emulate screen media before calling page.pdf():
await page.emulateMediaType('screen');
await page.pdf({ path: 'screen-layout.pdf', format: 'A4', printBackground: true });
Puppeteer’s Page class reference documents PDF generation with print media and the media-emulation method. The choice depends on the result you want: print CSS is generally appropriate for a document intended for paper or conventional PDF reading, while screen CSS can preserve the web layout more closely.
Set paper size, margins, and page ranges
The documented PDF options include format, width, height, landscape, margin, and pageRanges. If you provide format, it takes priority over width and height. Specify the geometry and margins explicitly when the output must meet a particular print or document requirement.
| Option | What it controls |
|---|---|
format |
Named paper size, such as 'A4'. When specified, it takes priority over width and height. |
width, height |
Paper dimensions when not overridden by format. |
landscape |
Whether to use landscape orientation. |
margin |
Page margins. |
pageRanges |
Which pages to include in the generated PDF. |
preferCSSPageSize |
Whether CSS @page size takes priority over the PDF options’ paper size. Its documented default is false; when false, content is scaled to fit the selected paper size. |
The full option definitions are in Puppeteer’s PDFOptions reference. With preferCSSPageSize: true, as in the first example, CSS @page sizing can govern the paper size. If you need to control size from your script instead, set format or dimensions and leave CSS page sizing preference off.
Rank #3
- STAY ORGANIZED – Easily convert your paper documents into digital formats like searchable PDF files, JPEGs, and more.Power Consumption : 2.5W or less (Energy Saving Mode: 0.7W). Suggested Daily Volume : 500 scans..Does it contain liquid: no
- CONVENIENT AND PORTABLE –lightweight and small in size, you can take the scanner anywhere from home offices, classrooms, remote offices, and anywhere in between
- HANDLES VARIOUS MEDIA TYPES – Digitize receipts, business cards, plastic or embossed cards, reports, legal documents, and more
- FAST AND EFFICIENT – No technical hurdles or complicated setups here; easily scan both sides of a document at the same time, in color or black-and-white, at up to 12 pages-per-minute, and with a 20 sheet automatic feeder
- BROAD COMPATIBILITY – Works with both Windows and Mac devices, be it laptop or computer
Include backgrounds and control printed colors
Background graphics are omitted by default because printBackground defaults to false. Set printBackground: true when the PDF needs background colors or images. Puppeteer also notes that printed colors are modified by default; its Page reference points to -webkit-print-color-adjust when exact color rendering is needed. Add the rule to the page’s CSS where you control it:
* {
-webkit-print-color-adjust: exact;
}
This affects print rendering; it does not replace checking the PDF’s actual layout and colors on the target page.
Control headers, footers, and fonts
Set displayHeaderFooter to enable headers and footers, then provide headerTemplate and/or footerTemplate. The documented placeholders include date, title, URL, page number, and total pages. Puppeteer’s PDF options also document waitForFonts, which defaults to true and waits for document.fonts.ready. The reference notes this may require bringing a background page to the front. Check the PDFOptions reference for supported template details and options for the installed version.
Save to a file, return bytes, or stream the PDF
Write directly to a path
Use the path option when the application should save the file to disk:
Rank #4
- IRIScan Express, portable scanner : scans color and black and white documents a blazing speed up to 8ppm simplex. Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
- IRIScan Express mobile scanner is powered via an included micro USB 2. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan. USB cable provided. AC Adapter not provided and not needed.
- IRIScan flatbed scanner uses a simplex scanning mode allows for quick and straightforward scanning of single-sided documents. IRIScan with its full portable features is the ideal document scanners for computers.
- IRIScan document scanner : Versatile scanning capabilities, including scanning to Word, PDF, and Excel formats with companion software provided Readiris OCR
- Receipt scanner and card scanner with Additional features include scanning business cards directly to Outlook, photo scanning, and receipt scanning for efficient document management
await page.pdf({ path: 'page.pdf', format: 'A4' });
Work with returned PDF bytes
If path is omitted, page.pdf() returns a Uint8Array. You can pass those bytes to the storage or response layer your application uses:
const pdfBytes = await page.pdf({ format: 'A4', printBackground: true });
Use a readable stream
For an application that needs a readable stream, use page.createPDFStream(). Puppeteer documents both PDF generation methods in the Page class reference; choose the output form that fits how your program stores or serves the document.
Browser runtime and version considerations
Puppeteer says it is only guaranteed to work with its bundled browser. The LaunchOptions reference documents headless mode as enabled by default. If you configure a separately installed browser or another release channel, verify compatibility with the Puppeteer version and browser you deploy.
The linked PDFOptions and Page API references identify version 25.12.0, while the PDF guide is on Puppeteer’s next documentation path. APIs and defaults may change, so check the references matching your installed package before relying on a version-sensitive option.
Recommended Free Tools
Best Value
- Scanner type: Document
- Connectivity technology: USB
- With Auto Scan Mode, the scanner automatically detects what you're scanning
- Digitize documents and images
Common problems and fixes
- Background colors or images are missing: Set
printBackground: true; backgrounds are omitted by default. - The PDF has print styling instead of the visible screen layout: Call
page.emulateMediaType('screen')beforepage.pdf(). - Content is missing or half-rendered: Do not assume navigation completion means application data is ready. Wait for the relevant selector or application-specific condition before printing.
- Network-idle waiting never finishes: A page may continue polling or loading background requests. Replace the idle wait with a condition tied to the content needed in the PDF.
- The output uses an unexpected paper size: Check whether
formatoverrides width and height, and whetherpreferCSSPageSizelets CSS@pagesizing take priority. - Colors differ from the page: Printed colors are modified by default. If you control the page’s CSS and need exact print colors, use
-webkit-print-color-adjust: exact. - A separately installed browser behaves unexpectedly: Puppeteer only guarantees operation with its bundled browser. Verify the configured runtime and version compatibility.
- The PDF file is not created where expected: Check the supplied
pathand ensure the process can write to that location. If you omitpath, handle the returned bytes instead of expecting a file.
Or skip the browser setup
If you need a screenshot or PDF through an API rather than managing a browser runtime, ScreenshotNeo is a website screenshot API and MCP server for developers. Its one-request PDF option accepts PDF settings such as paper size, margins, landscape, and page ranges. This is a different workflow from Puppeteer: the example below requests a screenshot image.
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 API usage. ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Frequently Asked Questions
Does Puppeteer save the PDF as a file or return data?
With a path option, page.pdf() writes a file; without one, it returns a Uint8Array. Puppeteer also documents page.createPDFStream() for stream-based output.
Which browser should I use with Puppeteer in production?
Puppeteer guarantees compatibility with its bundled browser. If you configure another browser, verify compatibility with the installed Puppeteer and browser versions.
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.

