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

To save a live webpage as a PDF from a Linux shell, use Chrome or Chromium’s headless print-to-PDF option:

google-chrome --headless --print-to-pdf=page.pdf 'https://example.com'

Replace google-chrome with the executable installed on your system. This creates a rendered PDF, not a complete preservation of the page’s source code, assets, interactions, or network dependencies.

Save a webpage to PDF with headless Chrome

Chrome’s official headless CLI documentation supports printing a target page to PDF. Its basic form saves a file named output.pdf in the current working directory:

google-chrome --headless --print-to-pdf 'https://example.com'

To choose a filename explicitly, use the equals form supported by common Chrome and Chromium builds:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Lenovo Business Laptop - Linux Mint (Cinnamon) - Intel i5-1335U, 16GB RAM, 256GB SSD, 15.6" FHD 1920x1080 Display, Full Keyboard, Fast Charging
  • Intel Core i5-1335U Processor (12M Cache, 12 Threads, up to 4.6 GHz) - 256GB Solid State Drive - 16GB DDR4 SDRAM
  • 15.6" FHD (1920x1080) Non-Touch Anti-Glare Display - Intel UHD 620 Integrated Graphics - Stereo Speakers
  • 720p HD Webcam with Privacy Shutter. Integrated Microphone - Intel Dual Band Wireless-AC (2x2) 8265, Bluetooth Version 4.2
  • I/O Ports: 2x USB 3.0, 1x USB 3.1 Type-C 3.1, Headphone/Mic Combo Port, 4-in-1 Card Reader, HDMI, Kensington Mini-Lock Slot
  • Linux Mint (Cinnamon) 64-Bit - Keyboard with Full NumberPad - Fast Charging
google-chrome --headless --print-to-pdf=page.pdf 'https://example.com'

The official guide documents --print-to-pdf and the default output name; check the installed build’s help if it rejects the equals form. See Chrome’s headless command-line reference.

Remove the printed header and footer

For a cleaner PDF without printed URL, date, or page number, add the current documented flag:

google-chrome --headless --no-pdf-header-footer --print-to-pdf=page.pdf 'https://example.com'

Older versions may use the former flag name --print-to-pdf-no-header. If Chrome reports an unknown option, check the documentation or help output for the version actually installed.

Choose where the PDF is saved

A relative filename such as page.pdf is saved in the shell’s current working directory. Use an absolute path to choose a different location:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
HP 17 Business Laptop - Linux Mint Cinnamon - Intel Quad-Core i5-10210U, 32GB RAM, 1TB PCIe NVMe SSD + 1TB Storage HDD, 17.3" Inch HD+ (1600x900) Display
  • Intel Core i5-10210U (up to 4.2GHz) - 1TB PCIe NVMe + 1TB HDD - 32GB DDR4 SDRAM
  • 17.3" HD+ (1600x900) Display, Intel UHD Graphics 620
  • Built in HD 720p Webcam with Microphone - Bluetooth Version4.2
  • I/O Ports: 2x USB 3.1 (Data Only), 1x USB 2.0, 1x HDMI, 1x Headphone/Microphone Combo Jack
  • Linux Mint Cinnamon 64-Bit - 6-Row Keyboard w/ Full Numberpad
google-chrome --headless --print-to-pdf=/tmp/page.pdf 'https://example.com'

Ensure the destination directory exists and that your user can write to it. Keep the original URL and capture date alongside the file when those details matter; the PDF by itself does not establish when or from where the page was captured.

Control when Chrome captures dynamic content

Pages can load content after the initial navigation, including through scripts or delayed requests. Chrome provides timing options, but neither guarantees that every element has appeared.

Wait up to a fixed time

Use --timeout to set a maximum wait in milliseconds. For example, this asks Chrome to capture after at most five seconds:

google-chrome --headless --timeout=5000 --print-to-pdf=page.pdf 'https://example.com'

Advance virtual time

For some time-dependent page behavior, try a virtual-time budget:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Panasonic Toughbook CF-31 MK5 Rugged Laptop, 13.1in i5, 8GB 256GB (Renewed)
  • [ULTRA-RUGGED DESIGN] MIL-STD-810G and IP65 certified. Built to survive 6-foot drops, heavy rain, and extreme vibrations. Features a magnesium alloy chassis with an integrated carry handle for maximum portability
  • [4G LTE - WORK ANYWHERE] Integrated 4G LTE Multi-Carrier Mobile Broadband. Stay connected to the internet in remote areas or on the road without relying on Wi-Fi or phone hotspots. True mobile freedom for field professionals
  • [1200-NIT SUNLIGHT READABLE] 13.1" XGA Touchscreen with CircuLumin technology. At 1200 nits, it is nearly 4x brighter than a standard laptop, ensuring perfect visibility under direct, intense sunlight
  • [LINUX UBUNTU PRE-INSTALLED] Fast, secure, and bloatware-free. Optimized for developers, network engineers, and diagnostic software that thrives in a stable, open-source environment
  • [LEGACY SERIAL PORT] Features a native RS-232 Serial Port, HDMI, and USB 3.0. Essential for connecting directly to industrial machinery, CNCs, and automotive diagnostic tools without unreliable adapter
google-chrome --headless --virtual-time-budget=42000 --print-to-pdf=page.pdf 'https://example.com'

These settings can help with pages that need a brief delay or run timed code. They do not prove that a site has finished loading, and a page may still omit content that depends on user interaction, blocked requests, or conditions the headless browser cannot satisfy.

Other command-line renderers

Chrome is a practical starting point for a live site when you want a browser-based rendering path with JavaScript. Alternatives use different engines and suit different needs; no single renderer is established as best for every webpage.

wkhtmltopdf

Run the command with a URL and output filename:

wkhtmltopdf 'https://example.com' page.pdf

The project describes wkhtmltopdf as a headless command-line tool based on Qt WebKit. Its downloads page lists 0.12.6 as the stable series and gives June 11, 2020 as its release date. Because that release is dated, check the output carefully on modern pages rather than assuming current-browser fidelity. See the wkhtmltopdf project and its downloads and security notice.

The project warns against using wkhtmltopdf with untrusted HTML: unsanitized user-supplied HTML or JavaScript can lead to a complete server takeover. Do not feed it untrusted input without appropriate sanitization and isolation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Lenovo V15 Gen 4 - Business Laptop - AMD Ryzen 5 7430U - 15.6" FHD Display - 8GB RAM - 512GB SSD Storage - Integrated AMD Radeon™ Graphics - Webcam Privacy Shutter - Business Black
  • THE POWER TO STAY PRODUCTIVE – Looking to make your everyday work and home life more manageable without breaking the bank? The Lenovo V15 Gen 4 offers long-term reliability with top-of-the-line features to make you your most productive self.
  • CRUSH YOUR TO-DO LIST – The AMD Ryzen CPU pairs quiet performance and enhanced operating power to crush your high-demand workday. It optimizes performance and allows for seamless multitasking.
  • TRUE-TO-LIFE VISUALS – The 15.6” FHD IPS display is anti-glare with 300 nits brightness to see your best outside or in. Its 88% screen-to-body ratio makes viewing detailed applications like spreadsheets a breeze.
  • SEAMLESS COLLABORATION – Lenovo Smart Appearance enhances your camera effects to protect your privacy and to make you the focus of every video conference. Intelligent noise cancelation minimizes distraction and Dolby Audio provides an elegantly sonorous experience.
  • BUILT TO WITHSTAND – Built for military-grade toughness, the V15 Gen 4 is tested to withstand harsh temperatures, pressure, humidity, vibrations and more. Keep your work safe from the board room to your living room and everywhere in between.

WeasyPrint

WeasyPrint can render a URL to PDF with:

weasyprint 'https://weasyprint.org' /tmp/page.pdf

Its documentation notes that unsupported CSS properties can produce warnings, so inspect both the output and any warnings when layout matters. It also documents PDF/A output, a constrained format with limitations such as no audio, video, or JavaScript and requirements concerning color spaces and fonts. Consult WeasyPrint’s first steps and common use cases.

What a PDF archive preserves—and what it does not

A PDF is a rendered document. It can preserve a visual representation of the page at capture time, but it is not a full web archive: it does not necessarily include original source, linked assets, interactions, or network dependencies. The cited tool documentation does not claim otherwise.

For records where provenance matters, store the source URL and capture date with the PDF. For preservation that must include underlying files or behavior, a print-to-PDF command alone is not sufficient; choose an archiving method designed for that requirement.

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 an API-based capture, ScreenshotNeo can return a screenshot or PDF from one GET request. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers identifying the page verdict and billing status. Its MCP server gives AI agents tools for screenshots, page information, and PDF capture.

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

Example cURL request (replace the URL with the page you want to capture):

Best Value
Lenovo IdeaPad Slim 3 Linux Laptop, 15.6" FHD Touchscreen Laptop, 8-Core AMD Ryzen 7 5825U, 16GB RAM, 512GB SSD, Keypad, SD Card Reader, Stylus Pen + External Portable SSD + USB Hub, Linux Ubuntu OS
  • Powerful Linux Laptop: This IdeaPad Slim 3 Laptop comes pre-installed with Ubuntu Linux, offering fast performance, robust security, and a clean, user-friendly experience. Enjoy full customization, seamless hardware compatibility, and access to thousands of open-source apps. Whether you're working, creating, or coding, it's built to keep up with everything you do.
  • A Multitasking Master: The latest AMD Ryzen 7 5825U processor (up to 4.5 GHz) delivers powerful performance with 8 cores and 16 threads for smooth multitasking. Integrated AMD Radeon Graphics provide crisp visuals for streaming, browsing, photo editing, and casual gaming. With smart machine intelligence, it adapts to your needs for a fast, responsive experience.
  • 15.6" Full HD Display: The IdeaPad Slim 3 boasts an 88% screen-to-body ratio for a floating, edge-to-edge visual experience. TÜV Low Blue Light certification reduces eye strain, making it perfect for long work or study sessions.
  • Military-Grade Durability: The smart IdeaPad Slim 3 combines portability and durability, letting you work, study, and play on the go. With a profile 10% slimmer than the previous generation, it's lightweight yet military-grade rugged, ready for anything, anywhere.
  • Versatile Connectivity: Enjoy the security of a built-in webcam with a privacy shutter. Connect effortlessly with multiple ports: 2x USB A, 1x USB C, 1x HDMI, 1x SD Card Reader, 1x Headphone/Microphone combo. Bundle comes with Stylus Pen, 256GB Portable SSD and 5-in-1 Docking Station.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o page.pdf

See the ScreenshotNeo API documentation for PDF options and authentication. The service offers 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000. Learn about ScreenshotNeo or sign up for 1,000 free screenshots a month, with no card.

Frequently Asked Questions

Does a PDF prove what a webpage looked like on a particular date?

Not by itself. Keep a dated capture record and the page URL with the PDF if you need that context.

Can Chrome’s timeout flags guarantee that every page element appears?

No. The timeout and virtual-time budget affect capture timing, but neither guarantees that all dynamic or interaction-dependent content has loaded.

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.

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.