October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

wkhtmltopdf Does Not Load Local CSS or Images: Fixes

When wkhtmltopdf omits local stylesheets or images, check local-file access first, then image settings, paths, media handling, print CSS, and wrapper options.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If wkhtmltopdf reports “Blocked access to file” or a PDF is missing local stylesheets or images, check its local-file access policy first. In wkhtmltopdf 0.12.6, local-file access is disabled by default: use --enable-local-file-access for broad access, or repeat --allow <path> to grant access to specific folders. Then confirm image loading is enabled, the asset paths exist in the conversion environment, and your wrapper passes the settings you expect.

Start with the input type and wkhtmltopdf build

Before changing flags, record whether the input is a local HTML file, standard input, or a URL, along with the exact wkhtmltopdf version and whether a wrapper or library launches the conversion. The option behavior below is documented in the wkhtmltopdf 0.12.6 usage reference; packaged builds and wrappers may differ.

A local HTML file that references other local files is subject to local-file access controls. A URL input, stdin input, or a wrapper-managed page can have different path and option behavior, so avoid treating one path format as universally correct.

Allow the HTML document to read local assets

The 0.12.6 CLI reference documents local-file access as disabled by default. Choose the narrowest permission that suits the job.

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

Allow access broadly for a trusted conversion

wkhtmltopdf --enable-local-file-access input.html output.pdf

This permits a local input to read other local files. Use it only where the conversion input and referenced assets are trusted.

Allow only the required asset folders

wkhtmltopdf --allow /path/to/assets --allow /path/to/styles input.html output.pdf

--allow <path> is repeatable and permits files from specified folders. This is preferable when the conversion should not have broad access to local files. The documentation also lists --disable-local-file-access as the default policy: local files are denied unless allowed with --allow.

Check that image loading is enabled

Image loading is on by default in the CLI reference, but it can be turned off with --no-images. Remove that option or explicitly use --images while isolating the problem:

wkhtmltopdf --images --enable-local-file-access input.html output.pdf

In a library integration, check the effective web.loadImages setting. Also inspect load.blockLocalFileAccess, which controls local-file access. The documented library settings are described in the wkhtmltopdf library page settings reference.

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.

Verify asset paths from the conversion process

A stylesheet or image can be present on your workstation but absent, unreadable, or located elsewhere in the environment that actually runs wkhtmltopdf. Check each referenced file against that runtime’s filesystem and permissions.

  • Confirm the exact CSS and image paths referenced by the HTML and by any CSS url(...) rules.
  • Verify the conversion process can see those files and read them.
  • Check that the relevant directories are covered by --allow if access is restricted.
  • Account for the location and input mode of the HTML rather than assuming a relative path will resolve identically for a file, URL, stdin, and wrapper.

The project references document access controls but do not establish one path-resolution rule that applies to every operating system, input mode, and wrapper.

Inspect media errors instead of trusting a successful PDF exit

The CLI reference documents --load-media-error-handling, whose default is ignore. As a result, a conversion can produce a PDF even when media failed to load. Review stderr and the conversion’s loading behavior; for diagnosis, select an error-handling mode that makes media failures visible or stops the conversion, as appropriate for your workflow.

The library reference exposes load.loadErrorHandling for the same class of behavior. A missing-media PDF is not proof that every asset path was valid.

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

Compare screen and print rendering

--print-media-type selects print media instead of screen media. Print-specific CSS can hide elements, change backgrounds, or otherwise alter what appears in the PDF.

Rank #4
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
  • Transform audio playing via your speakers and headphones
  • Improve sound quality by adjusting it with effects
  • Take control over the sound playing through audio hardware

If resources disappear only when this option is used, compare otherwise identical conversions with and without it and inspect the rules active in print media. A macOS 12.6.1 report involving wkhtmltopdf 0.12.6 described images disappearing with the option and returning without it; that is an individual case, not evidence of a general rendering defect. The option and behavior are documented or reported at the wkhtmltopdf usage reference and the macOS issue report.

Check wrapper and library settings

A command that works in a shell may fail through a binding if the wrapper does not pass equivalent settings to the conversion process or applies options to the wrong page/object. Inspect the effective options for the page or object being converted, including local-file access and image loading.

  • CLI: check the actual argument list passed to wkhtmltopdf, not just the command you intended to run.
  • Library: inspect web.loadImages, load.blockLocalFileAccess, load.loadErrorHandling, and load.printMediaType.
  • Wrapper: verify the options are applied to the specific conversion page/object and that the wrapper’s installed wkhtmltopdf build is the one you expect.

A Go wrapper issue demonstrates a blocked local stylesheet in a wrapper context, but it does not establish how every binding behaves: Go wrapper issue report.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
WavePad Audio Editing Software - Professional Audio and Music Editor for Anyone [Download]
  • Full-featured professional audio and music editor that lets you record and edit music, voice and other audio recordings
  • Add effects like echo, amplification, noise reduction, normalize, equalizer, envelope, reverb, echo, reverse and more
  • Supports all popular audio formats including, wav, mp3, vox, gsm, wma, real audio, au, aif, flac, ogg and more
  • Sound editing functions include cut, copy, paste, delete, insert, silence, auto-trim and more
  • Integrated VST plugin support gives professionals access to thousands of additional tools and effects
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Minimal troubleshooting sequence

  1. Record input type, wkhtmltopdf version/build, operating system, wrapper, and the exact command or effective settings.
  2. For a local input, test --enable-local-file-access. If broad access is not appropriate, replace it with repeatable --allow <path> entries for needed directories.
  3. Ensure neither --no-images nor a library setting disabling images is in effect.
  4. Check that every CSS and image exists and is readable where the conversion process runs.
  5. Inspect stderr and media error handling; do not assume a produced PDF means resources loaded.
  6. Compare print and screen media if the failure tracks with --print-media-type.
  7. For wrappers, inspect the settings and arguments that actually reach the page/object conversion.

Common symptoms and fixes

Symptom Likely check Next action
“Blocked access to file” for a local stylesheet or image Local-file access policy Use --enable-local-file-access for trusted broad access or add an appropriate --allow <path>.
CSS loads but images do not Image setting, image path, or image-specific load failure Confirm images are enabled, then verify each image path and permissions; inspect media loading errors.
PDF is created but styles or images are absent Default media error handling may ignore missing media Review stderr and configure media error handling to expose failures during diagnosis.
Shell command works but application conversion fails Wrapper arguments or page/object settings differ Inspect effective library settings and the actual process invocation.
Images disappear only with print mode Print CSS or behavior specific to the environment Compare with and without --print-media-type and inspect print rules; do not assume the single reported case applies generally.
Images still fail after enabling local-file access Wrong or inaccessible path, permissions, input mode, or wrapper behavior Check the conversion runtime’s view of the files and verify the setting reached the process. A Windows 10 issue report documents this symptom despite the flag, but does not identify a universal cause: Windows issue report.

Or skip the browser setup

If your actual task is to capture a web page as an image or PDF rather than convert local HTML, ScreenshotNeo offers a one-request API. It returns PNG, JPEG, WebP, or PDF and can remove cookie banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed; response headers identify the page verdict and billing status. Its MCP server lets AI agents use screenshot and PDF capture tools.

Example cURL request (see 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

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.

Quick Recap

Bestseller No. 1
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
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
Transform audio playing via your speakers and headphones; Improve sound quality by adjusting it with effects

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.