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 DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk6 min

How to Archive a Webpage as a PDF with wkhtmltopdf

Use wkhtmltopdf to convert a webpage URL into a PDF, tune layout and print options, and troubleshoot missing or delayed content.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use wkhtmltopdf 'https://example.com/page' 'page.pdf' to convert a webpage URL into a PDF. The command-line tool renders HTML with Qt WebKit; after conversion, open the file and check that the text, images, links, layout, and page breaks are usable. Results depend on the page and the wkhtmltopdf build installed on your system.

What you need before converting a page

wkhtmltopdf is a headless, open-source command-line tool for rendering HTML into PDF. Its documented syntax is wkhtmltopdf [GLOBAL OPTION]... [OBJECT]... <output file>. You can install a suitable precompiled binary for your operating system or build the project from source. The available project materials do not establish a current recommended release or support status, so consult the documentation for your installation rather than assuming all packaged builds behave alike.

As an Amazon Associate I earn from qualifying purchases.

After installing it, check the version and available help in a terminal:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • wkhtmltopdf --version identifies the installed build.
  • wkhtmltopdf -H displays command-line help. The project documentation describes its generated manual as equivalent to this help output.

Use the manual associated with your installed build for exact option availability and defaults.

#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

Convert one webpage to PDF

  1. Open a terminal.
  2. Run wkhtmltopdf 'https://example.com/page' 'page.pdf', replacing the URL with the page you want to archive and the output path with your preferred filename and location.
  3. Wait for the command to finish, then open the PDF. Check the content and page breaks before treating it as a useful archive.

The project’s basic example uses the same pattern: a page URL followed by an output filename. Quote URLs and paths so the shell handles characters such as ampersands and spaces as part of the argument rather than as command syntax.

Choose page size, orientation, and margins

The documented manual uses A4 and portrait as defaults. Set explicit layout options when the PDF must fit a particular paper format or when a wide page is easier to read in landscape.

  • --page-size A4, --page-size Letter, or another listed size sets the paper format. The manual also lists A3 and Legal and supports custom width and height.
  • --orientation Landscape selects landscape orientation.
  • --margin-top, --margin-bottom, --margin-left, and --margin-right set margins; provide values in the format accepted by your build’s help.

For example, to request Letter paper in landscape with room for a footer, consult your installed manual for margin units and use the corresponding options. Don’t assume a page designed for a tall screen will paginate cleanly just because the paper size is correct.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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)

Control print styling and backgrounds

--print-media-type asks wkhtmltopdf to use print CSS instead of the documented default, screen media. This can change colors, visibility, and layout if the site defines separate print styles; it does not guarantee that those styles will produce a complete or attractive PDF.

The documented manual enables background printing by default. Use --no-background when you want to omit backgrounds. Print-media selection and background printing are separate choices, so check the output for both page styling and background assets.

Add page headers and footers

The manual supports text or HTML headers and footers. For example, a right-aligned page count can be added with --footer-right 'Page [page] of [topage]'. Documented variables include [page], [topage], [webpage], [title], and [isodate].

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

Leave enough top or bottom margin for the header or footer; otherwise it can collide with page content. Confirm the placement in the generated PDF, especially when combining headers with custom margins.

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

Handle JavaScript and delayed content

The CLI manual documents controls to enable or disable JavaScript, set a JavaScript delay, wait until a specified window status, and run a script after page load. A delay or load hook may help when content appears after the initial page load, but these controls do not guarantee compatibility with every dynamic site.

If expected content is missing, inspect the page in a browser and compare what is visible there with the PDF. Try a suitable delay or documented wait condition, then regenerate and check again. If the result remains incomplete, a browser’s built-in print-to-PDF option is a reasonable alternative to try for pages that rely on browser behavior wkhtmltopdf does not reproduce.

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

Authentication, headers, proxies, and local files

The manual includes controls for HTTP authentication, custom headers, and proxy settings. These are configuration options, not a guarantee that a protected page will load. Use them only for pages and accounts you are authorized to access, and avoid placing credentials where they may be exposed in shell history or logs.

For local HTML conversions, wkhtmltopdf has local-file access controls, including an option to disable access with an allow-list mechanism and an option to enable it. Keep permissions as narrow as the task allows; do not grant broad local-file access just because a page happens to reference local resources.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Capture multiple documents, a cover, or a table of contents

The documented command structure accepts multiple objects. A sequence can include pages, a cover, and a generated table of contents before the output filename. A cover omits headers and footers and is excluded from the table of contents; the TOC is generated using XSLT. These features are useful for compiling documents, but they are not needed for a single-page PDF. Check the manual for your build’s exact object syntax.

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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check the PDF and troubleshoot common problems

Conversion success alone does not establish that the file is a faithful archive. Open the PDF and check text, images, layout, links, and page breaks against the page you intended to capture.

  • The command is not found: wkhtmltopdf may not be installed or may not be on your shell’s executable path. Install a build appropriate for your operating system or correct the path, then run wkhtmltopdf --version.
  • The PDF is blank or missing content: the page may depend on JavaScript, delayed loading, authentication, or resources that failed to load. Check access in a browser, review the build’s JavaScript and wait controls, and inspect the resulting PDF. A browser’s print-to-PDF path is another option to try.
  • Images or styles are absent: the page may rely on remote resources that did not load, or local resources affected by file-access settings. Check the conversion output and the relevant network, proxy, header, or local-file configuration without widening permissions unnecessarily.
  • Text or layout is cut off: try a different paper size or orientation, adjust margins, and inspect whether print CSS changes the page. Recheck the PDF after each meaningful change.
  • Headers overlap the page: reserve more margin space for the header or footer and regenerate the file.
  • A protected page fails: verify that you are authorized and that the required authentication or headers are configured for the installed build. The existence of authentication controls does not ensure that the site will permit conversion.

Or skip the browser setup

For an API-based capture, ScreenshotNeo takes a URL in one GET request and returns a screenshot or PDF. Its cleanup options accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and whether the request was billed. It also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents and other MCP clients.

Example cURL request:

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

See the ScreenshotNeo API documentation for request options and response details. The service also supports PDF settings such as paper size, margins, landscape, and page ranges. Its free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.

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

Frequently Asked Questions

Can wkhtmltopdf turn a local HTML file into a PDF?

Yes. The manual includes local-file access controls for conversions involving local HTML and resources; use the narrowest permissions that meet your needs.

Does wkhtmltopdf guarantee that a modern JavaScript-heavy site will render completely?

No. Its documented JavaScript and wait controls may help with delayed content, but compatibility depends on the page and installed build.

How can I check which wkhtmltopdf options my installation supports?

Run wkhtmltopdf -H and consult the manual associated with that build.

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 *

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

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.