Use wkhtmltopdf to convert a webpage URL into a PDF from your terminal. The basic command is wkhtmltopdf 'https://example.com/page' 'page.pdf'; add options for paper size, orientation, margins, print styling, or headers and footers, then open the PDF to check the result.
Convert one webpage to PDF
wkhtmltopdf is a headless, open-source command-line tool that renders HTML into PDF using Qt WebKit. Its documented command syntax is wkhtmltopdf [GLOBAL OPTION]... [OBJECT]... <output file>. For one page, the URL is the input object and the final argument is the output filename. See the project documentation and the command-line manual.
- Install a binary suitable for your operating system, or build the project from source. The project documentation describes both approaches; check the documentation and distribution associated with the build you install.
- Open a terminal and run
wkhtmltopdf 'https://example.com/page' 'page.pdf'. Replace the URL with the webpage you are authorized to access, and choose the output path and filename you want. - Open the PDF and inspect its text, images, layout, links, and page breaks. Results depend on the page and the installed build.
To check which build is installed, run wkhtmltopdf --version. The project documentation says its auto-generated documentation is equivalent to running wkhtmltopdf -H; consult the manual for your installed build because packaged versions can differ.
Choose PDF page size and layout
The documented defaults are A4 paper and portrait orientation. Specify options when the intended print format or page layout calls for something else.
Recommended Free Tools
#1 Best Overall
- 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
| Need | Option or example | What it changes |
|---|---|---|
| Use another paper size | --page-size Letter, --page-size A3, or --page-size Legal |
Selects a listed paper format. Custom width and height are also supported by the manual. |
| Set page orientation | --orientation Landscape |
Uses landscape rather than the documented portrait default. |
| Change margins | --margin-top 15mm --margin-bottom 15mm --margin-left 12mm --margin-right 12mm |
Sets each margin independently. Leave enough room for headers and footers if you use them. |
| Request print styles | --print-media-type |
Requests print media styles rather than the documented screen-media default. It does not guarantee that a site’s print styles will produce a complete or clean PDF. |
| Suppress backgrounds | --no-background |
Disables background printing, which is enabled by default in the documented manual. |
For example, this command requests Letter paper, landscape orientation, and print media styles:
wkhtmltopdf --page-size Letter --orientation Landscape --print-media-type 'https://example.com/page' 'page.pdf'
Backgrounds and print media are separate settings: selecting print media changes which styles are requested, while --no-background controls background printing. Inspect the output to decide whether the page’s styles and background assets produced the intended result.
Rank #2
- 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)
Add headers and footers
The manual supports text or HTML headers and footers. For page numbering, add a footer such as --footer-right 'Page [page] of [topage]'. Other documented variables include [webpage], [title], and [isodate].
Free tools Windows power users keep installed
One-click scans. No signup required.
Example with a page-number footer:
wkhtmltopdf --margin-bottom 18mm --footer-right 'Page [page] of [topage]' 'https://example.com/page' 'page.pdf'
Give the footer enough margin space so it does not crowd the page content. Check the generated PDF to confirm that the footer appears as intended.
Rank #3
- 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
Handle dynamic pages and missing content
The command-line manual documents controls for enabling or disabling JavaScript, adding a JavaScript delay, waiting for a specified window status, and running a script after page load. A delay or script hook may help when content appears after the initial load, but these controls do not ensure that every dynamic site will render correctly.
- If content is missing, inspect the PDF and try a browser’s built-in print-to-PDF workflow as a fallback.
- If images or other remote resources are absent, check whether the page loaded those resources successfully and whether the target site requires an authenticated session.
- Use the manual’s load-error and media-error handling options to configure how errors are treated; they do not make inaccessible resources available.
For pages requiring authentication, the manual documents HTTP authentication and custom headers. Proxy settings are also available. These are configuration controls, not a guarantee that a protected page can be accessed; use them only with pages you are authorized to view.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Convert local HTML carefully
When converting local HTML, local-file access controls can affect whether the document loads resources from disk. The manual documents an option to disable local access with an allow-list mechanism and an option to enable it. Keep access as narrow as the task allows; do not grant broad access to local files without a reason.
Rank #4
- 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
Combine pages, a cover, or a table of contents
The command supports multiple objects in sequence, including page, cover, and table-of-contents objects. A cover omits headers and footers and is excluded from the table of contents. The table of contents is generated using XSLT. These features are useful for assembling a multi-part PDF, but are not needed for a single webpage conversion; consult the manual for the object syntax and options.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If you need a screenshot rather than a PDF, ScreenshotNeo can return a webpage capture as PNG, JPEG, or WebP with one request. For PDF output, use wkhtmltopdf or a browser’s print-to-PDF workflow.
For example, save this as a shell command, replacing the URL with the page you want to capture:
Best Value
- Scanner type: Document
- Connectivity technology: USB
- With Auto Scan Mode, the scanner automatically detects what you're scanning
- Digitize documents and images
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/page -o shot.webp
See the ScreenshotNeo API documentation for request options. Before capture, it accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers indicate the page verdict and billing status. 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 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Frequently Asked Questions
Does wkhtmltopdf guarantee a faithful copy of a modern website?
No. The documentation describes a Qt WebKit renderer and provides JavaScript and load-timing controls, but it does not establish universal compatibility with dynamic sites.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Can I make one PDF from several webpage sections?
Yes. The command supports page, cover, and table-of-contents objects in sequence; consult the installed build’s manual for the syntax.
Quick Recap
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.

