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 desk5 min

wkhtmltopdf Exit Code 1: Common Causes and How to Fix Them

Exit code 1 is a symptom, not a diagnosis. Use the stderr message to identify the failed page or asset, check access from the wkhtmltopdf runtime, and verify the resulting PDF.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

wkhtmltopdf exit code 1 is not a diagnosis on its own. Read the complete standard-error output to find which page, asset, URL, or local file failed to load; then fix that specific access or resource problem. A PDF file may still appear on disk after a nonzero exit, so check its contents as well as the process status.

What exit code 1 means in wkhtmltopdf

The exit status tells you the conversion did not complete cleanly, but it does not identify the cause. The useful clue is usually the detailed error that follows a message such as Error: Failed to load or Exit with code 1 due to network error. Reported examples include HostNotFoundError, ProtocolUnknownError, and ContentOperationNotPermittedError. These are examples, not a complete error taxonomy. See the reported cases for host lookup failure, protocol error, and HTTP 403 and content access error.

As an Amazon Associate I earn from qualifying purchases.

Do not treat a PDF’s presence as proof that every page or resource loaded. Some reported runs produced a file despite returning a nonzero status; inspect the output for missing content before relying on it.

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

Diagnose the failure before changing options

  1. Capture the complete error output. Preserve the exact command and stderr rather than copying only the final exit message.
  2. Record the runtime details. Note the output of wkhtmltopdf --version, the binary or package source, operating system and version, and whether a wrapper launches the executable.
  3. Locate every failed resource. For each Error: Failed to load line, identify the URL or file and whether it is the main page, stylesheet, script, image, iframe, header, or footer.
  4. Test access from the same environment. Check the URL or file as the same user, container, and runtime identity that runs wkhtmltopdf—not just from your desktop browser.
  5. Fix the underlying cause. Check hostname resolution, outbound network access, proxy settings, redirects, authentication, HTTP response, URL syntax, relative paths, permissions, and local-file access policy as applicable.
  6. Re-run and verify both outcomes. Check the exit status and stderr, then review the generated PDF for missing or incomplete content.

The project’s support guidance asks for the version, operating system and version, a detailed description, and a reproducible example. Reducing the input to a small HTML file and only the assets needed to reproduce the failure makes the cause easier to isolate.

#1 Best Overall
Brother Compact Monochrome Laser Printer, HLL2395DW, Flatbed Copy & Scan, Wireless Printing, NFC with Refresh Subscription Free Trial and Amazon Dash Replenishment Ready
  • Engineered for convenience – This new Brother Monochrome Laser Printer is conveniently equipped with a flatbed scan glass for quick copying and scanning. Mobile Device Compatibility AirPrint, Google Cloud Print 2.0, Brother iPrint and Scan, Mopria, Cortado Workplace
  • Optimized for efficiency – Engineered with new features, the HL L2395DW laser printer (replacement for the HLL2380DW) and has been optimized for efficiency, allowing you to print up to 36 pages per minute(1)
  • Faster, high quality prints: This monochrome laser printer is built with a 250 sheet paper capacity that helps improve efficiency due to less time spent refilling trays. It also handles both letter and legal sized paper. Power Source AC 120V 50/60Hz.Machine Noise (Ready/Printing): 30dB / 50dB
  • Cloud based print & scan – Print from and scan to popular Cloud services directly from the 2.7" color touchscreen, including Dropbox, Google Drive, Evernote, OneNote, and more(4)
  • Wireless printing & exceptional support – This printer’s simple to connect wireless technology allows you to submit print jobs from your laptop, smartphone, desktop, and tablets(2). The "Touch to connect" printing with NFC delivers added convenience(3).

Common causes and fixes

Host lookup or network reachability problems

If the error names a host or remote URL, test that resource from the machine or container running wkhtmltopdf. Check DNS resolution, outbound connectivity, proxy configuration, redirects, and whether the resource host is reachable there. A reported HostNotFoundError occurred while converting a document that referenced remote assets and an iframe; the report does not establish which individual resource caused it. See the reported host lookup case.

Local files blocked or relative paths resolving incorrectly

For local HTML, confirm that every linked CSS file, script, image, and other resource resolves relative to the actual input location or to an intentional base URL. Check file permissions and wkhtmltopdf’s local-file-access settings. The command-line documentation describes --disable-local-file-access, --enable-local-file-access, and --allow for specifying files permitted to load; see the CLI usage documentation.

A Windows issue reported blocked CSS, JavaScript, and image files followed by ProtocolUnknownError for about:blank. Treat that as a clue to inspect paths and access settings, not proof that every about:blank error has the same cause; see the reported protocol error. Grant only the local-file access needed for the conversion, especially when the HTML is not fully trusted.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Brother MFC-L3710CW Compact Digital Color All-in-One Printer Providing Laser Printer Quality Results with Wireless, Amazon Dash Replenishment Ready
  • FAST PRINT AND SCAN: The Brother MFC-L3710CW lets you get things done with up to 19 ppm print speed and scans up to 29 ipm in black and 22 ipm in color
  • AFFORDABLE AND FLEXIBLE COLOR PRINTING: Affordably print professional quality, rich, vivid color documents with laser printer quality. The 250 sheet adjustable paper tray helps minimize refills and the manual feed slot handles varied printing needs
  • 3.7” COLOR TOUCHSCREEN: Print from and scan to popular cloud apps directly from the 3.7" color touchscreen including Dropbox, Google Drive, Evernote, OneNote and more. Save time by creating custom shortcuts on the touchscreen for your most used features.
  • PRINT AND CONNECT YOUR WAY: Print wirelessly from your desktop, laptop, smartphone and tablet with built-in wireless, and Wi-Fi Direct or connect locally to a single computer via USB interface.
  • UNIT DIMENSIONS (WxDxH): 16.1” W x 18.7” D x 16.3” H

HTTP errors, SSL, authentication, or redirects

When stderr names an HTTPS resource, check the full URL and the response actually returned to wkhtmltopdf, including redirects and authentication requirements. One archived report describes an HTTP 403 and ContentOperationNotPermittedError in an SSL setup. Check whether the resource is authorized and accessible to the conversion process; that report does not establish that changing the URL to HTTP is safe or appropriate. See the reported 403 case.

Malformed or unsupported resource URLs

ProtocolUnknownError or an error naming about:blank can warrant inspection of generated HTML for empty, malformed, or unsupported resource URLs. Pay particular attention to URLs created by JavaScript or embedded in CSS. A 2022 report found different behavior in one Python pdfkit.from_string(html, False) setup depending on whether output was returned or written to a file path. That is a wrapper-specific report, not evidence that return-mode output is generally faulty; compare the wrapper’s input and generated command with a direct invocation. See the reported case.

Error-handling options

The CLI documents --load-error-handling <handler> for pages that fail to load, with abort as the default and ignore and skip as alternatives. It also documents --load-media-error-handling <handler> for media failures, with ignore as the default. Refer to the official option descriptions for exact usage.

Rank #3
MixPad Free Multitrack Recording Studio and Music Mixing Software [Download]
  • Create a mix using audio, music and voice tracks and recordings.
  • Customize your tracks with amazing effects and helpful editing tools.
  • Use tools like the Beat Maker and Midi Creator.
  • Work efficiently by using Bookmarks and tools like Effect Chain, which allow you to apply multiple effects at a time
  • Use one of the many other NCH multimedia applications that are integrated with MixPad.

Use a handler that tolerates missing content only when that content may safely be absent. These switches do not guarantee every network error will be ignored or that the process will exit successfully. After changing one, inspect stderr, status, and PDF content; reported cases show that a file can coexist with exit code 1. See the host lookup report and the protocol error report.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Security and version considerations

The wkhtmltopdf downloads page identifies 0.12.6 as the stable series and gives June 11, 2020 as its release date. This is the information stated on that page, not proof that every operating-system package is equivalent or that no later fork or build exists. Check the version and provenance of the binary actually installed before applying a version-specific fix; see the downloads page.

The project warns: “Do not use wkhtmltopdf with any untrusted HTML – be sure to sanitize any user-supplied HTML/JS, otherwise it can lead to complete takeover of the server it is running on!” This matters when enabling local-file access or processing HTML that can execute JavaScript. See the project security warning.

Rank #4
Corel PDF Fusion Software
  • Save money by using PDF Fusion to view over 100 file formats without having to purchase additional software
  • Merge incompatible files quickly and easily by dragging and dropping in PDF Fusion to create a new PDF documents
  • Save time with PDF Fusion's editing tools to reuse the content from existing documents without starting from scratch

Or skip the browser setup

If the task is simply to capture a website as an image or PDF, ScreenshotNeo offers a one-request screenshot API and an MCP server. For example, the cURL request below saves a WebP screenshot:

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

See the ScreenshotNeo API documentation for options and setup. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed. AI agents can take screenshots through its MCP server. The Free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.

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

Sign up for ScreenshotNeo’s free plan.

Frequently Asked Questions

Why does wkhtmltopdf create a PDF but still return exit code 1?

A nonzero status can accompany a file that appears to have been created. Check stderr and inspect the PDF for missing pages or resources before treating it as complete.

What information should I include when asking for help with exit code 1?

Provide the exact command, complete stderr, wkhtmltopdf version and binary or package source, operating system and version, and a minimal input that reproduces the failure.

Quick Recap

Bestseller No. 3
MixPad Free Multitrack Recording Studio and Music Mixing Software [Download]
MixPad Free Multitrack Recording Studio and Music Mixing Software [Download]
Create a mix using audio, music and voice tracks and recordings.; Customize your tracks with amazing effects and helpful editing tools.
Bestseller No. 4

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

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