October 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 PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

How to Make a PDF Archive of a Website That Requires JavaScript

Wait for a JavaScript page to render before saving it as a PDF. Use browser Print for a one-off capture or Playwright for repeatable output, and inspect the file because a PDF is not a replayable website archive.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To save a JavaScript-driven website as a PDF, first let the page render the content you need, then use the browser’s Print command and choose Save as PDF. For repeatable captures, automate a real browser with Playwright and wait for a page-specific readiness condition. Inspect the resulting PDF: a PDF preserves a rendered snapshot, not a working, replayable copy of the entire website.

Save a JavaScript website as a PDF manually

This is the simplest approach for a one-off capture. It does not require a physical printer.

As an Amazon Associate I earn from qualifying purchases.

  1. Open the exact page in a current browser and complete any legitimate sign-in or consent steps needed to view content you are allowed to access.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  2. Wait until the material you want—such as article text, a chart, or a list populated by the app—has appeared. A page can finish its initial load while still waiting for asynchronous data or lazy-loaded content.

    #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
  3. Open the browser’s Print command, choose the option to save or print to PDF, and save the file.

  4. Open the saved PDF and inspect its first and last pages, page breaks, text, tables, images, and below-the-fold content. Print styles may intentionally hide interface elements or change the layout.

If content is missing, return to the live page, wait for the relevant content, and create the PDF again.

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

Use Chrome Headless to print a page to PDF

Chrome’s Headless command-line reference documents --print-to-pdf, a maximum wait time with --timeout, and --no-pdf-header-footer to omit print headers and footers. For example:

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)
chrome --headless --print-to-pdf --no-pdf-header-footer --timeout=10000 "https://example.com/article"

Replace the URL with the page you want to capture. The documented command saves a file named output.pdf in the current working directory: Chrome Headless command-line reference. The timeout is a maximum wait, not proof that a particular site’s data has finished loading. If the page populates content later, inspect the PDF and use browser automation with a site-specific readiness check when necessary.

Automate PDF capture with Playwright

Playwright is useful when you need repeatable captures or want to control PDF layout. Its page.pdf() method uses print CSS by default. The API also documents screen-media emulation and controls for paper size, margins, background printing, scale, and tagged output. See the Playwright Page API and media emulation documentation.

Runnable Node.js example

Install Playwright and its Chromium browser first:

npm init -y
npm install playwright
npx playwright install chromium

Save the following as capture.mjs, replace the URL and readiness selector with values for the target site, then run node capture.mjs:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { chromium } from 'playwright';

const url = 'https://example.com/article';
const readySelector = 'article';

const browser = await chromium.launch({ headless: true });
try {
  const page = await browser.newPage();
  await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });
  await page.locator(readySelector).waitFor({ state: 'visible', timeout: 30000 });

  await page.pdf({
    path: 'archive.pdf',
    format: 'A4',
    printBackground: true,
    margin: { top: '15mm', right: '15mm', bottom: '15mm', left: '15mm' }
  });
} finally {
  await browser.close();
}

Choose a selector that appears only when the material you need is available; a generic selector such as body may appear before app data is ready. If the site has no reliable selector, use a delay only as a fallback and verify the output. No single wait strategy works for every site. For pages that should retain their screen styling rather than print styling, call await page.emulateMedia({ media: 'screen' }) before page.pdf().

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

Choose PDF settings deliberately

  • Print or screen appearance: print CSS is the default. Emulate screen media when the screen layout is the one you need to preserve.

  • Backgrounds: background printing is off by default; set printBackground: true when colors or background graphics convey information. Check that the result remains legible.

  • Paper and pagination: use a supported paper format or explicit dimensions, and adjust margins or scale if content clips or breaks awkwardly. Inspect the page boundaries; no single setting guarantees a good layout across sites.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Accessibility: Playwright documents a tagged PDF option. Tagging alone does not establish accessibility conformance; assess the output against the requirements and tools for your use case.

    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

Or skip the browser setup

For a PDF capture through an API, ScreenshotNeo accepts a URL in one GET request. This example saves the returned PDF; see the ScreenshotNeo API documentation for PDF options and setup.

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

ScreenshotNeo removes known cookie and consent banners, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with the result identified in response headers. Its MCP server provides screenshot and PDF tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Fix common PDF capture problems

The PDF is blank or missing app content

The page may have been captured before its JavaScript-rendered data appeared, or the app may require an authorized sign-in or consent action. Check the live page first. In automation, wait for the specific content rather than relying on a fixed pause. Chrome’s timeout only caps waiting; it does not certify that a site is ready. Chrome Headless and Playwright’s PDF API document capture controls, not a universal readiness delay.

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

The PDF looks different from the browser

Playwright uses print media by default, and the site may have print-specific CSS. Emulate screen media before generating the PDF if you need screen styling. Also review the browser’s print scaling, paper size, and margins.

Colors or backgrounds are missing

In Playwright, background printing defaults to false. Set printBackground: true when needed, then confirm text and graphics have sufficient contrast.

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

Content is clipped or page breaks are awkward

Inspect where each page begins and ends. Adjust the paper size, margins, or scale, or use site-specific print CSS if available. Recheck the resulting file because layout depends on the page.

The PDF cannot preserve the whole website

A PDF is a fixed-layout record of rendered content; it does not preserve the site’s scripts, network resources, or behavior as a replayable website. For web-resource aggregation, WARC is a relevant archival format, but captured resources and their rendering are distinct concerns. The Library of Congress describes WARC’s purpose and components; the National Archives discusses dynamic content and screenshot limitations; and the IIPC specification explains that rendering depends on implementation: Library of Congress WARC description, National Archives format transfer guidance, and IIPC WARC specification.

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

Keep useful capture context

For a consequential record, keep the source URL, capture date and time, browser and version, access context, and relevant print settings alongside the PDF. This helps explain how the snapshot was created; it does not turn the PDF into a complete website archive.

Frequently Asked Questions

Do I need a printer to save a web page as a PDF?

No. Use the browser’s Print command and choose its Save as PDF or equivalent destination; the PDF is saved as a file.

Does a PDF archive preserve interactive JavaScript features?

No. It records a rendered page as a fixed-layout document, not the scripts or behavior needed to replay the site.

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.

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

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.