Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Use Puppeteer’s page.pdf() method: launch its bundled browser, navigate to the page, wait for the content you need, then save the resulting PDF. Puppeteer prints with print CSS by default; set page size, margins, and background handling explicitly when the output needs to be predictable.
Capture a webpage as a PDF
Install Puppeteer in a Node.js project, then run this ES module script. It navigates to a URL, writes an A4 PDF with background graphics, and closes the browser even if capture fails.
As an Amazon Associate I earn from qualifying purchases.
import puppeteer from 'puppeteer';
const url = process.argv[2] ?? 'https://example.com';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto(url, { waitUntil: 'networkidle2' });
await page.pdf({
path: 'page.pdf',
format: 'A4',
printBackground: true,
preferCSSPageSize: true,
});
} finally {
await browser.close();
}
Save it as capture.mjs and run node capture.mjs https://example.com. Puppeteer’s documented workflow is to launch the browser, create a page, navigate, and call page.pdf(). The guide’s example uses networkidle2, but that wait condition is not a guarantee that every site’s application content is ready. See the Puppeteer PDF generation guide and check the API references matching your installed package version.
Recommended Free Tools
Wait for the content you need
The script’s networkidle2 navigation condition is a reasonable starting point, not a universal readiness test. Pages that poll continuously, load content after navigation, or render from application state may need a page-specific condition before printing.
#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 page element
If the page has a reliable element that appears when the content is ready, wait for that selector after navigation:
await page.goto(url, { waitUntil: 'domcontentloaded' });
await page.waitForSelector('#article-content');
await page.pdf({ path: 'page.pdf', format: 'A4', printBackground: true });
Replace #article-content with a selector that exists on the target page. Puppeteer’s wait options document navigation lifecycle events such as load (the general default); select the event and subsequent readiness check for the page rather than assuming one load event fits every site. The Page API also documents waitForNetworkIdle(), which waits for at least its configured idle time. See WaitForOptions and the Page API.
Fonts and background pages
Puppeteer’s PDF generation guide says that, by default, page.pdf() waits for fonts to load. The PDF options reference documents waitForFonts as enabled by default; it also notes that this may require bringing a background page to the front. If font-dependent layout is wrong, check that the fonts actually load and that the page is not being kept in the background before changing this setting.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsChoose print or screen styling
page.pdf() renders using the print CSS media type by default, so print stylesheets and print-specific rules determine the layout. If the PDF should resemble the on-screen page instead, emulate screen media before calling page.pdf():
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)
await page.emulateMediaType('screen');
await page.pdf({ path: 'page.pdf', format: 'A4', printBackground: true });
This changes the media type used for rendering; it does not bypass the rest of the page’s layout or readiness requirements. Puppeteer also notes that printed colors are modified by default. If exact color rendering matters, its Page reference points to the CSS property -webkit-print-color-adjust. See the Page class reference.
Set paper size, margins, and page range
The PDF options let you define paper geometry and which pages to include. Set these values deliberately rather than depending on defaults.
formatselects a standard paper format such asA4. Whenformatis set, it takes priority overwidthandheight.- Use
widthandheightwhen you need custom dimensions instead of a named format. - Set
landscape: truefor landscape orientation. - Use
marginto define page margins, andpageRangesto restrict output to selected pages. - Set
preferCSSPageSize: truewhen the page’s CSS@pagesize should take priority over the PDF options’ dimensions. Its documented default is false; with that default, content is scaled to fit the requested paper size.
For example, this uses landscape A4, explicit margins, and a page range:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallawait page.pdf({
path: 'selected-pages.pdf',
format: 'A4',
landscape: true,
margin: { top: '12mm', right: '12mm', bottom: '12mm', left: '12mm' },
pageRanges: '1-3',
printBackground: true,
});
If the document’s own @page rules should control the paper size, use preferCSSPageSize: true and avoid setting competing geometry without a reason. The available fields and documented defaults are in Puppeteer’s PDFOptions reference.
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 headers or footers
Background graphics are omitted by default: printBackground defaults to false. Set it to true when the PDF should include background colors or images.
Headers and footers are controlled by displayHeaderFooter, headerTemplate, and footerTemplate. The documented template placeholders include date, title, URL, page number, and total pages. Configure the templates when you need those details; do not assume headers or footers will appear unless enabled. Full option details are in the PDFOptions API reference.
Save to a file, use the PDF bytes, or stream the result
Write directly to a path
Set path in page.pdf(), as in the runnable example, to write a PDF file.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Keep the returned bytes
When path is omitted, page.pdf() returns a Uint8Array. This is useful when the surrounding application needs to store or serve the generated PDF itself:
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
const pdfBytes = await page.pdf({ format: 'A4', printBackground: true });
Use a readable stream
Use page.createPDFStream() when your application needs a readable stream rather than a path or returned byte array. Both PDF-generation methods are documented in the Page API.
Browser runtime and version considerations
Puppeteer says it is only guaranteed to work with its bundled browser. The example uses the browser installed for the package by the normal Puppeteer setup; if you configure a separately installed browser or another release channel, check compatibility and deployment implications for the versions you are using. Puppeteer’s LaunchOptions reference documents headless mode as enabled by default.
The PDFOptions and Page references identified for this guide are version 25.12.0, while the PDF generation guide is on Puppeteer’s next documentation path. APIs and defaults can change, so check the documentation that matches your installed Puppeteer version before relying on version-sensitive syntax or behavior.
Troubleshoot common PDF problems
The PDF is missing background colors or images
Set printBackground: true. Its documented default is false.
Best Value
- Scanner type: Document
- Connectivity technology: USB
- With Auto Scan Mode, the scanner automatically detects what you're scanning
- Digitize documents and images
The PDF layout differs from the browser view
Puppeteer uses print media for PDF generation by default. Use page.emulateMediaType('screen') before generating the PDF if screen CSS is the intended layout. If print media is correct but colors differ, check the print color behavior and the documented -webkit-print-color-adjust guidance.
The output has the wrong paper size or scaling
Check the interaction between format, width, height, and CSS @page. A set format takes precedence over explicit width and height; preferCSSPageSize is false by default, so CSS page size does not automatically take priority over the requested paper size.
Content is missing or appears half-rendered
A navigation lifecycle event or network-idle condition may happen before the site has finished rendering the content you care about. Wait for a relevant selector or application-specific readiness condition before printing. Puppeteer waits for fonts by default, but that does not mean asynchronous page data is ready.
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 →The browser works locally but not in deployment
Confirm which browser runtime the deployment launches. Puppeteer only guarantees compatibility with its bundled browser; a separately installed browser requires deliberate version and deployment checks.
Or skip the browser setup
If you need a PDF from a URL without managing a Puppeteer browser, ScreenshotNeo provides a website screenshot API that can return a PDF. Its features include PDF paper size, margins, landscape, and page ranges; see the API documentation for request options.
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
This one-call example returns an image; configure PDF output and its options using the API documentation. ScreenshotNeo accepts cookie or 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 or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response reports the page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for free.
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.




