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 DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

How to Capture a Webpage as a PDF from the Browser Console

Use window.print() in the page’s browser console to open print preview, then choose a PDF destination and save. For unattended output, use Chrome Headless.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run window.print() in the page’s browser console, then choose a PDF destination in the print dialog and save. The command opens the browser’s normal print flow; it does not silently download or save a PDF for you.

Capture the page as a PDF from the console

  1. Open the webpage you want to save.
  2. Open the browser’s developer tools and select the Console. In Firefox, the documented Web Console shortcut is Ctrl+Shift+K on Windows/Linux or Cmd+Opt+K on macOS; shortcuts differ in other browsers and may vary by setup. Mozilla’s Web Console documentation explains how to run expressions in the page context.
  3. Enter window.print() and press Enter.
  4. In the print dialog, choose the PDF destination, review the preview and settings, then save the file.
window.print();

MDN describes window.print() as opening the print dialog for the current document. If the document is still loading, the method waits for it to finish; while the dialog is open, the call blocks. MDN: Window.print()

As an Amazon Associate I earn from qualifying purchases.

Choose the PDF destination and check the preview

Destination labels and available controls depend on the browser, operating system and print system. For example, Chrome Help says to select “Save as PDF”; Firefox Help says to choose “Save to PDF” under Destination. Chrome printing instructions · Firefox printing instructions

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Check the page range, orientation, paper size and scale so content is not clipped or made unreadably small.
  • Adjust margins and headers or footers if they interfere with the page.
  • Enable background graphics if the PDF needs the page’s colored backgrounds or other background styling.

A print layout is not necessarily a copy of the live screen. Firefox notes that a site can be configured to look different on paper; preview the output and change print settings before saving. Edge documents similar controls for paper size, margins, scale and background graphics. Microsoft Edge printing instructions

#1 Best Overall
Sale
Epson Workforce ES-50 Compact & Lightweight Mobile Document Scanner
  • 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

When the console method is useful—and when it is not

The console is a convenient way to trigger the same interactive print flow without using the keyboard shortcut or menu. It still requires a person to choose the PDF destination and save. It is therefore suitable for an occasional capture, not unattended batch work.

Because the call waits if the document is loading, it does not provide a separate control for waiting on a particular image, selector or application update. If a page fills in content after it initially loads, wait until the desired content appears before running the command, then inspect the preview.

Rank #2
Sale
Brother DS-640 Compact Mobile Document Scanner, (Model: DS640)
  • 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)

Automate PDF output with Chrome Headless

For unattended Chrome output, Chrome for Developers documents a separate command-line workflow using --headless --print-to-pdf. Run this in a terminal, not the browser console:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
chrome --headless --print-to-pdf https://example.com/

The command writes output.pdf to the current working directory. Depending on the installation, you may need to use the full path to the Chrome executable and replace the example URL with the page you need. Chrome’s documented options include:

Rank #3
Sale
Epson Workforce ES-400 II High-Speed Color Duplex Desktop Document Scanner
  • FAST DOCUMENT SCANNING — Document scanner with feeder allows you to speed through stacks with a 50-sheet Auto Document Feeder (ADF); Efficient office scanner to help you scan more productively
  • INTUITIVE, HIGH-SPEED SOFTWARE — Quickly scan with this desktop document scanner; Epson ScanSmart Software lets you easily preview scans, email files, upload to the cloud, and more; Plus, automatic file naming saves even more time
  • SEAMLESS INTEGRATION — Easily incorporate your data into most document management software with the included TWAIN driver; Office document scanner integrates seamlessly with business workflows
  • EASY SHARING — Duplex scanner allows you to scan straight to email or popular cloud storage2 services like Dropbox, Evernote, Google Drive, and OneDrive for simple storage and sharing
  • SIMPLE FILE MANAGEMENT — Scanner allows the creation of searchable PDFs with Optical Character Recognition (OCR) and convert scans to editable Word or Excel files effortlessly; Designed for home and office document scanning
  • --no-pdf-header-footer suppresses the date/time header and URL/page-number footer.
  • --timeout=5000 waits up to five seconds before capture.
  • --virtual-time-budget=42000 advances virtual time for time-dependent page code.

These numbers are example flag values in Chrome’s documentation, not general guarantees about how long a particular page needs. Adjust timing for the page and verify the resulting PDF. Chrome Headless documentation

Troubleshooting

  • The console says the command is undefined or shows an error: Confirm you are in the Console for the tab containing the page and that the expression is window.print(). The command applies to the current document.
  • No PDF file appears after running the command: That is expected until you select a PDF destination in the print dialog and complete the save action. window.print() does not select a destination on its own.
  • The PDF is missing content or looks different from the page: Wait for the relevant content to appear, reopen or refresh the preview, and check the page’s print layout, scale, margins and background settings.
  • The page is split awkwardly or text is clipped: Try a different orientation, scale, paper size or margin setting, and review the preview before saving.
  • The automated PDF is captured too early: Increase or change the Chrome Headless timing option appropriate to the page, then check the output. A fixed wait cannot guarantee that every site’s dynamic content has finished loading.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

For a direct PDF capture through an API, ScreenshotNeo takes one GET request with a URL and can return a PDF. Its capture flow accepts cookie or consent banners like a visitor 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 responses identify the page verdict and billing status in headers. It also offers an MCP server with capture_pdf for AI agents.

Example cURL request, adapted to capture a PDF:

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

See the ScreenshotNeo API documentation for request options and response details. ScreenshotNeo has a free plan with 1,000 screenshots per month and no card required; paid plans start at $5 for 3,000. Visit ScreenshotNeo and sign up for 1,000 free screenshots a month, with no card.

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

Quick Recap

Bestseller No. 4
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Scanner type: Document; Connectivity technology: USB; With Auto Scan Mode, the scanner automatically detects what you're scanning
$75.00
Best Value
Sale
ScanSnap iX2500 Wireless or USB High-Speed Document Scanner, Black
  • OUR MOST ADVANCED SCANSNAP. Large touchscreen, fast 45ppm double-sided scanning, 100-sheet document feeder, Wi-Fi and USB connectivity, automatic optimizations, and support for cloud services. Upgraded replacement for the discontinued iX1600
  • CUSTOMIZABLE. SHARABLE. Select personalized profiles from the touchscreen. Send to PC, Mac, mobile devices, and clouds. QUICK MENU lets you quickly scan-drag-drop to your favorite computer apps
  • STABLE WIRELESS OR USB CONNECTION. Built-in Wi-Fi 6 for the fastest and most secure scanning. Connect to smart devices or cloud services without a computer. USB-C connection also available
  • PHOTO AND DOCUMENT ORGANIZATION MADE EFFORTLESS. Easily manage, edit, and use scanned data from documents, receipts, photos, and business cards. Automatically optimize, name, and sort files
  • AVOIDS PAPER JAMS AND DAMAGE. Features a brake roller system to feed paper smoothly, a multi-feed sensor that detects pages stuck together, and skew detection to prevent paper damage and data loss
Rank #4
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
  • Scanner type: Document
  • Connectivity technology: USB
  • With Auto Scan Mode, the scanner automatically detects what you're scanning
  • Digitize documents and images

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
PC Slower Than It Used to Be?Free scan - under a minute
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.