ScreenshotNeo

BlogHow-to

How to Check Your wkhtmltopdf Version

Check the wkhtmltopdf binary your system uses, resolve multiple installations, and troubleshoot PATH or package-version mismatches.

By the ScreenshotNeo team1 October 20266 min read

Run this command:

wkhtmltopdf --version

The short form is equivalent:

wkhtmltopdf -V

Both commands print version information for the wkhtmltopdf executable resolved by your current shell, then exit. The manual documents -V, --version as “Output version information and exit.”

1. Check the version from a terminal

Linux and macOS

wkhtmltopdf --version
wkhtmltopdf -V

Typical output includes the program name and a version number. Copy the complete output when reporting a problem; packaging suffixes and build details can matter.

Windows Command Prompt or PowerShell

wkhtmltopdf.exe --version
wkhtmltopdf.exe -V

If the executable directory is not on PATH, use its full path. In PowerShell, quote paths containing spaces:

& "C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe" --version

2. Confirm which executable is being used

The version command checks the binary your shell finds first. A machine can contain several copies installed by a system package, a downloaded installer, a container image, or an application bundle.

Linux

command -v wkhtmltopdf
which -a wkhtmltopdf
readlink -f "$(command -v wkhtmltopdf)"
"$(command -v wkhtmltopdf)" --version

which -a lists every matching entry on PATH. readlink -f resolves symlinks on systems that provide it.

macOS

command -v wkhtmltopdf
which -a wkhtmltopdf
realpath "$(command -v wkhtmltopdf)" 2>/dev/null || true
"$(command -v wkhtmltopdf)" --version

Homebrew installations may be linked into a directory that differs from the downloaded application location, so inspect the resolved path rather than assuming the installer location.

Windows

where.exe wkhtmltopdf

Run the version command against each path returned:

"C:\path\to\wkhtmltopdf.exe" --version

In PowerShell, you can inspect the command resolution:

Get-Command wkhtmltopdf -All

3. Check the binary your application actually invokes

A service may use a configured absolute path instead of the shell’s PATH. Check the path in your application configuration, worker process, container image, or systemd unit, then run that exact file:

/opt/wkhtmltopdf/bin/wkhtmltopdf --version

For a container, run the command inside the same image and user context as the application:

docker exec <container-name> wkhtmltopdf --version

Record both the resolved path and its output in deployment diagnostics. This prevents a local shell version from being mistaken for the production version.

4. Understand the upstream version information

The official downloads page identifies 0.12.6 as the stable series and dates that release to June 11, 2020. Your installed output does not have to be exactly 0.12.6: distribution packages and builds can include packaging revisions or differ by installation source. Treat the executable’s actual output as authoritative for your machine.

The upstream GitHub repository is archived and read-only. Its release information identifies the 0.12.6 tag and points to packaging-repository releases for binary builds. Check the project’s downloads page and release information when identifying where a binary came from.

5. Display all command-line options

To inspect the capabilities of the executable you found, print its generated help:

wkhtmltopdf -H

The help output can reveal build-specific options and is useful when comparing two installations. Save it alongside the version output when diagnosing differences.

6. Troubleshooting common errors

Symptom Cause Fix
command not found: wkhtmltopdf The package is missing or its directory is not on PATH. Install a package for your operating system, add its executable directory to PATH, open a new shell, or run the binary by full path.
“wkhtmltopdf is not recognized…” Windows cannot resolve the executable. Use where.exe wkhtmltopdf, add the installation’s bin directory to PATH, or invoke the full .exe path.
The shell and application report different versions They resolve different binaries or run in different containers/users. Inspect the application’s configured path and run that exact binary with --version.
The output has a revision suffix The distributor added packaging or build metadata. Keep the complete output; compare the underlying series and build source rather than deleting the suffix.
Permission denied The file is not executable or the user cannot access its directory. Check file permissions and execute it as the same user as the service. Avoid changing permissions more broadly than necessary.
A script finds no binary but an interactive shell does Non-interactive services often have a smaller PATH. Use an absolute path in the service configuration or set PATH explicitly for that process.

7. Add a repeatable version check to diagnostics

Capture the path, version, and help header in deployment logs:

#!/usr/bin/env sh
set -eu
BIN="${WKHTMLTOPDF_BIN:-wkhtmltopdf}"
printf 'binary: %s\n' "$BIN"
command -v "$BIN" 2>/dev/null || true
"$BIN" --version
"$BIN" -H | sed -n '1,20p'

Set WKHTMLTOPDF_BIN to an absolute path when several installations are possible. This script only reports information; it does not change the installed version.

8. Security note for server-side conversion

wkhtmltopdf is a command-line HTML-to-PDF tool using Qt WebKit. The project warns not to process untrusted HTML with it unless user-supplied HTML and JavaScript are sanitized, because unsafe input can lead to complete takeover of the server. Apply input validation, isolation, least-privilege execution, and network restrictions appropriate to your deployment before converting user-controlled content. See the warning in the project’s usage documentation.

9. When you need a managed screenshot or PDF capture

Checking a local wkhtmltopdf version is useful for a command-line or self-hosted workflow. If you need a hosted capture endpoint, ScreenshotNeo provides one GET request for a PNG, JPEG, WebP, or PDF and has an MCP server for AI clients.

Or skip the browser setup

Use the API instead of maintaining a local browser or PDF binary. Full option details are in the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and whether the request was billed. Its MCP tools let Claude, Cursor, and other MCP clients take screenshots, inspect pages, and capture PDFs. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots.

Create a free ScreenshotNeo account to get started.

10. Performance, reliability, and cost considerations

  • Version consistency: pin the binary source and path in deployments so upgrades do not silently change rendering.
  • Reproducibility: record operating system, architecture, executable path, complete version output, and relevant command options.
  • Isolation: run conversion with a restricted user and limit access to untrusted network or filesystem resources.
  • Hosted alternative: ScreenshotNeo supports caching with a caller-selected TTL, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, and a usage API. Select options based on latency, freshness, and volume.

FAQ

Is -V different from --version?

No. They are the documented short and long forms for printing version information and exiting.

Does the command tell me the newest upstream release?

No. It reports the executable being run. Compare it with the project’s downloads and release pages to understand upstream context.

Why does my package say 0.12.6 while another machine shows extra text?

Packages and builds can add revision or distribution metadata. Compare the full output and the binary path.

How can I check a version from code?

Invoke the configured absolute executable with an argument array such as ["--version"], capture stdout and stderr, and log the exit status. Avoid passing untrusted strings through a shell.

Can I use wkhtmltopdf with untrusted HTML?

Only after applying strong sanitization and isolation. The project explicitly warns about server takeover risks from unsanitized HTML and JavaScript.