Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk8 min

How to Batch Convert Website URLs to PDF Files

Use Chrome Headless for a simple URL-to-PDF batch, or Puppeteer for finer control over waits, filenames, and failures.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To batch-convert website URLs into separate PDFs, put one URL on each line and run a browser once per URL. Chrome Headless is the quickest command-line option; Puppeteer or Playwright is better when you need custom waits, filenames, logging, or retries. These methods create one PDF per page—the list processing and error handling are steps you add around the browser’s single-page PDF operation.

Choose how to run the batch

Approach Best suited to Trade-off
Chrome Headless A small, straightforward list and a machine with Chrome installed Simple per-URL command; a loop, file naming, and failure logging are your responsibility. Chrome’s command-line reference documents a single target URL per invocation.
Puppeteer A repeatable Node.js workflow with per-page waits and error handling Requires Node.js and browser automation setup. Its PDF guide shows navigation followed by PDF generation; the batch loop is yours to implement.
Playwright A scripted workflow using Playwright’s page and PDF APIs Requires the Playwright runtime and browser setup. Its Page API documents PDF generation behavior.

The workflows below save one PDF for each URL. Making a single combined PDF is a separate merge step; the browser documentation cited here covers creating a PDF from an individual page, not merging a batch.

As an Amazon Associate I earn from qualifying purchases.

Prepare the URL list and output folder

  1. Create a plain-text file named urls.txt with one complete URL per line, for example https://example.com/. This is a convenient input convention, not a browser-enforced standard.
  2. Create an output directory named pdfs. Use a separate, predictable filename for each URL so one page cannot overwrite another.
  3. Check that the machine can reach the pages and that you are permitted to automate their retrieval. A browser workflow does not bypass access controls or guarantee that a site will allow automated capture.
  4. Start with a few URLs and inspect the resulting PDFs before processing a longer list. Check that dynamic content appeared and that print styles did not hide important material.

Batch print with Chrome Headless

Chrome Headless can save a target page as a PDF with --print-to-pdf. Chrome’s documentation says the flag saves a PDF named output.pdf in the current working directory; a shell loop can give each invocation its own output path. The following Bash example reads urls.txt, numbers output files, and records failures.

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

Save this as batch-pdf.sh in the directory containing urls.txt:

#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
#!/usr/bin/env bash
set -u

mkdir -p pdfs
: > failed-urls.txt
index=0

while IFS= read -r url || [[ -n "$url" ]]; do
  # Ignore empty lines and comments.
  [[ -z "$url" || "$url" == #* ]] && continue
  index=$((index + 1))
  output=$(printf 'pdfs/page-%04d.pdf' "$index")

  if ! google-chrome --headless --disable-gpu --no-sandbox 
      --timeout=30000 --print-to-pdf="$output" "$url"; then
    printf '%sn' "$url" >> failed-urls.txt
    rm -f "$output"
  fi
done < urls.txt

Run it with bash batch-pdf.sh. If your Chrome executable has a different name or location, replace google-chrome with that executable. The example uses a 30,000-millisecond timeout; Chrome’s CLI also documents --timeout and a virtual-time budget for controlling capture timing. A command that exits successfully is not a guarantee that the PDF contains every expected element, so inspect sample output.

The script uses --no-sandbox for environments where Chrome is commonly run without a usable sandbox, such as some containers. Do not add it reflexively to a normal desktop setup; follow your environment’s security requirements. For unattended jobs, keep failure logs and consider rerunning failed URLs after checking the cause.

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)

Use Puppeteer for more control

Puppeteer is useful when the batch needs custom page waits, browser settings, or structured error handling. Its documented PDF workflow launches a browser, navigates to a page, and calls page.pdf(). This Node.js script applies that operation to each nonblank line in urls.txt, names files sequentially, waits for network activity to settle, and continues after an individual URL fails.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Install Node.js, then create a project and install Puppeteer with npm init -y and npm install puppeteer.
  2. Save the following as batch-pdf.cjs alongside urls.txt.
  3. Run node batch-pdf.cjs. PDFs go into pdfs/, and failures are written to failed-urls.txt.
const fs = require('node:fs');
const path = require('node:path');
const puppeteer = require('puppeteer');

const urls = fs.readFileSync('urls.txt', 'utf8')
  .split(/r?n/)
  .map(line => line.trim())
  .filter(line => line && !line.startsWith('#'));

async function main() {
  fs.mkdirSync('pdfs', { recursive: true });
  fs.writeFileSync('failed-urls.txt', '');
  const browser = await puppeteer.launch({ headless: true });

  try {
    for (let i = 0; i < urls.length; i++) {
      const url = urls[i];
      const output = path.join('pdfs', `page-${String(i + 1).padStart(4, '0')}.pdf`);
      const page = await browser.newPage();

      try {
        await page.goto(url, {
          waitUntil: 'networkidle2',
          timeout: 30000,
        });
        await page.pdf({ path: output, format: 'A4', printBackground: true });
      } catch (error) {
        fs.appendFileSync('failed-urls.txt', `${url}t${error.message}n`);
        if (fs.existsSync(output)) fs.unlinkSync(output);
      } finally {
        await page.close();
      }
    }
  } finally {
    await browser.close();
  }
}

main().catch(error => {
  console.error(error);
  process.exitCode = 1;
});

networkidle2 is a practical starting point, not a universal signal that a page is complete. Sites with long-lived network requests may never become idle, while pages that load content later may appear idle too early. If that happens, wait for a selector that identifies the content you need, or use a deliberate delay and check representative output. Puppeteer and Playwright generate PDFs using print CSS by default; if the page’s screen layout is what you need, Puppeteer documents emulating screen media before calling page.pdf() in its Page.pdf() API.

Rank #3
Sale
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
  • 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

Account for print styling and dynamic pages

Print CSS can change the result

PDF generation is a print operation, not necessarily a snapshot of the ordinary browser window. Print styles may change colors, hide navigation or other elements, or alter layout. Puppeteer’s Page.pdf() API and Playwright’s Page API both document print-media behavior. Inspect the PDF and adjust media emulation or the page’s print styles when the printed representation is unsuitable.

Choose a wait that matches the page

Chrome Headless provides timeout and virtual-time controls. Puppeteer’s PDF guide demonstrates waiting for network activity before generating a PDF. Neither approach guarantees that every site’s delayed or JavaScript-rendered content is ready at a particular moment. For important pages, select a page-specific readiness condition and validate the output rather than relying on one timing rule for the entire web.

Rank #4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
  • 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

Expect site-specific limits

Automated browsing may encounter login requirements, bot checks, rate limits, unavailable pages, or content that does not print correctly. These workflows do not establish that every website permits automated capture or that a PDF preserves interactive, protected, or dynamically changing content.

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

Handle larger batches responsibly

  • Throttle requests: avoid launching many simultaneous browser pages against one site. The reviewed documentation sets no universally safe batch size.
  • Keep logs: record failed URLs and error messages, then retry only after identifying whether the cause was a transient load issue, access restriction, or invalid URL.
  • Use stable filenames: sequential filenames avoid collisions, but a separate URL-to-filename manifest can make it easier to map output files back to their source addresses.
  • Check representative PDFs: inspect pages near the beginning, middle, and end of a long list for missing content, unwanted page breaks, and print-style changes.
  • Budget for rendering time: each URL requires navigation and PDF generation. The official sources do not provide a guaranteed batch speed or throughput figure; actual time depends on the pages and environment.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

Symptom Likely cause What to try
No PDF appears or Chrome cannot launch The executable name or path is wrong, Chrome is not installed, or the process lacks required environment setup. Run the Chrome executable directly with --headless --print-to-pdf=output.pdf and one URL first. Use the actual executable path for your installation.
A PDF exists but is blank or incomplete The page had not rendered required content, navigation timed out, or content requires interaction or authentication. Open the URL in a normal browser, determine what content is accessible, then use a suitable wait condition and inspect the saved PDF. Do not treat automation as a way around access controls.
Images or colors are missing Images may be lazy-loaded, resources may not have finished loading, or print styles may omit backgrounds. Check the page in a browser and the generated PDF. In Puppeteer, printBackground: true requests background printing; it does not guarantee every resource will load.
Layout differs from the screen page The PDF uses print CSS by default. Review the page’s print stylesheet and, where appropriate, use Puppeteer’s documented screen-media emulation before PDF generation.
Some URLs fail while others succeed Individual pages may be unavailable, slow, malformed, or restricted. Keep the failed-URL log, verify each address, and retry selectively with a suitable timeout. Do not discard successful files just because another URL failed.
A batch is taking too long Pages may be slow, the wait condition may be overly strict, or requests may be competing for resources. Test a representative page, tune its wait policy, and process a controlled number of pages at a time. No universal batch size or speed is established by the cited docs.

Or skip the browser setup

ScreenshotNeo is a website screenshot API with a PDF capture option. It is useful when you want a hosted capture request rather than installing and maintaining a local browser. The following cURL call requests a PDF for one URL; for a batch, call it once for each URL and choose a distinct output filename.

Best Value
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

See the ScreenshotNeo documentation for request options and the PDF parameters.

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

ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response includes X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The Free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to try 1,000 shots a month without a card.

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.

Frequently Asked Questions

Can I create one combined PDF from all the URLs?

The Chrome, Puppeteer, and Playwright workflows described here create a PDF for an individual page. Combining those files requires a separate PDF-merging step.

Will a PDF look exactly like the webpage on screen?

Not necessarily. Browser PDF generation uses print CSS by default, which can change layout or omit screen-only elements.

Quick Recap

SaleBestseller No. 3
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
BROAD COMPATIBILITY – Works with both Windows and Mac devices, be it laptop or computer; This product is not intended for scanning photographs on photo paper / photographic media
$153.00
Bestseller No. 4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
Find our Software here : irislink.com/start; IRIScan Express is only compatible Windows platform and not macintosh
$129.00
Bestseller No. 5
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

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 *

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.