When an SVG displays in Chrome or Firefox but disappears in a PDF generated by wkhtmltopdf, the cause is usually the rendering path or resource access—not simply whether the image is base64 encoded. wkhtmltopdf uses an old Qt WebKit engine, and SVG support can differ between an external <img>, inline markup, and <object>. Record your exact build, reduce the document to a minimal test, verify every nested image can be read, and then choose the least disruptive workaround.
Why SVGs fail in wkhtmltopdf
wkhtmltopdf converts HTML to PDF with Qt WebKit rather than a current Chromium or Firefox engine. The project’s status page says that Qt 4 “hasn’t been supported since 2015” and that its WebKit “hasn’t been updated since 2012” (wkhtmltopdf project status). A browser preview therefore does not prove that the bundled engine will decode the same SVG features.
Failures become more likely when an SVG contains nested <image> elements, external files, filters, web fonts, or references resolved relative to a different base URL. Historical issue reports show inconsistent behavior rather than one universal defect: an SVG with an embedded base64 JPEG failed when loaded through HTML <img> in one 0.12.3 patched-Qt environment, while putting the SVG markup inline made the embedded images visible but disturbed other elements (issue #2996). Another report describes an SVG included with <object> appearing blank (issue #3762).
Treat those reports as environment-specific evidence. The reliable fix is a controlled diagnosis in the same binary and operating system that creates your production PDF.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
1. Capture the exact wkhtmltopdf environment
Run the version command on the machine that performs conversion:
wkhtmltopdf --version
Save the complete output and note whether it says “with patched qt.” The usage documentation identifies 0.12.6 with patched Qt, while the nested-image report used 0.12.3 with patched Qt; those builds should not be assumed equivalent (usage documentation). Also record:
- Operating system and CPU architecture.
- The exact command-line options and working directory.
- Whether the HTML is read from a file, standard input, or a URL.
- Where the SVG and its referenced images are stored.
- Whether conversion runs locally, in a container, under a service account, or in a sandbox.
Run every experiment with that same invocation. A result from a developer laptop can hide permission, path, or build differences in production.
2. Build a minimal reproduction
Remove unrelated CSS, JavaScript, fonts, filters, and page-layout code. Keep the SVG’s explicit width, height, and viewBox, then test one inclusion route at a time.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →External SVG through img
<!doctype html>
<html><body>
<img src="assets/graphic.svg" width="600" height="300" alt="Test graphic">
</body></html>
wkhtmltopdf --enable-local-file-access test-img.html test-img.pdf
The --enable-local-file-access option is relevant when the SVG or its nested resources are local files. Confirm the option is permitted by your installed build and review the settings reference for local-file controls and load-error behavior (settings reference).
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Inline SVG
<!doctype html>
<html><body>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 300" width="600" height="300">
<rect width="600" height="300" fill="#eef2ff"/>
<image href="assets/photo.jpg" x="20" y="20" width="560" height="260" preserveAspectRatio="xMidYMid slice"/>
</svg>
</body></html>
Inline markup can change how the legacy engine resolves the document and its resources. Issue #2996 reports that this made nested images visible but caused other elements to render incorrectly, so inspect the entire page rather than accepting the first apparent improvement.
SVG through object
<object data="assets/graphic.svg" type="image/svg+xml" width="600" height="300"></object>
Because issue #3762 reports a blank result for this route, use it as a comparison test, not as a guaranteed solution.
3. Inspect nested images and URLs
Open the SVG as text and inspect every <image> element. Modern files may use href, older files may use xlink:href, and a file can contain both. Classify each value:
Recommended Free Tools
- Data URI: check the media type and base64 padding. A data URI removes a separate file request but does not add unsupported SVG features to Qt WebKit.
- Relative path: resolve it from the SVG document’s base URL, not necessarily from the HTML file or your shell’s current directory.
- Absolute file URL: verify the path exists and that the conversion account can read it.
- HTTP or HTTPS URL: test DNS, TLS, authentication, redirects, and whether the target blocks the wkhtmltopdf user agent.
Try one known-good raster image first. If that works, add the real nested image, then filters, masks, clipping paths, fonts, and scripts one feature at a time. This isolates the failing resource or SVG construct.
4. Verify local-file policy and load errors
A blank nested image can be an access failure rather than an SVG parser failure. Check directory permissions for the account running wkhtmltopdf, container mounts, symlinks, and case-sensitive filenames. Use explicit, stable paths while diagnosing. The official settings API documents local-file access restrictions and controls for handling resource-load errors (settings reference).
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Do not assume that enabling local access fixes remote assets, or that embedding one image as base64 makes every other dependency local. Fonts, CSS, linked images, and nested SVG references each need their own successful load.
5. Apply workarounds in a controlled order
Try inline SVG when page fidelity allows it
Move the complete <svg> element into the HTML and preserve its namespace, dimensions, and viewBox. Compare the PDF for text position, clipping, filters, and neighboring elements. Keep this approach only if the whole page remains correct.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Normalize references
Use a single, predictable base directory and rewrite relative references so they resolve from the actual SVG location. Avoid relying on a browser’s network cache or on a working directory that differs between development and production.
Rasterize the affected graphic
If vector output is not essential, convert the SVG to PNG or another raster format with an SVG-capable tool before conversion, then reference that image from HTML. Choose dimensions and resolution for the final PDF size; a small source bitmap can look soft when enlarged. This is a general engineering workaround, not a confirmed fix from the cited wkhtmltopdf issues. Qt’s current vector documentation explains SVG capabilities in Qt, but it does not specify the behavior of wkhtmltopdf’s older bundled engine (Qt vector image documentation).
Evaluate a maintained renderer
If your document depends on modern SVG filters, fonts, CSS, or scripting that cannot be made reliable, test a maintained browser-based PDF renderer against representative documents. The wkhtmltopdf status page itself points readers toward newer browser engines (project status). Validate headers, footers, page breaks, fonts, asset authentication, sandboxing, and deployment size before migrating.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Choosing the right option
| Approach | Vector quality | Typical effort | Main risk |
|---|---|---|---|
Keep external img and fix access |
Preserved | Low when paths are wrong | Legacy SVG feature gaps remain |
| Inline the SVG | Preserved | Moderate | Other page elements may change, as reported in issue #2996 |
Use object |
Preserved if supported | Low to moderate | Blank output reported in issue #3762 |
| Rasterize selected graphics | Raster at chosen resolution | Moderate | Soft images, larger files, lost vector behavior |
| Change renderer | Depends on the maintained engine | Highest | Layout and deployment differences require regression testing |
No controlled benchmark establishes one option as universally best. Base the decision on the deployed binary, SVG complexity, required sharpness, asset-hosting model, maintenance cost, and whether the rest of the PDF layout must remain unchanged.
Free tools Windows power users keep installed
One-click scans. No signup required.
Troubleshooting common symptoms
The SVG is completely blank
- Check that the outer element has nonzero width and height and a usable
viewBox. - Test the same file through
img, inline markup, andobject. - Inspect stderr and enable the documented load-error behavior where appropriate.
- Verify local-file permissions and remote URL access.
The outer SVG appears but nested images do not
- Inspect
hrefandxlink:hrefvalues. - Replace the nested image with a tiny known-good PNG.
- Try a data URI, while remembering that base64 does not guarantee support for the surrounding SVG feature.
- Check that the image is not hidden by clipping, masks, opacity, or a zero-sized viewport.
Inline markup fixes the image but breaks other content
Compare the complete PDF, not only the image. Reduce filters, fonts, and scripts; isolate the first change that causes layout damage. If the SVG is self-contained, rasterize only that asset instead of changing the whole document.
The result differs between machines
Compare wkhtmltopdf --version, patched-Qt status, operating system, installed fonts, working directory, network policy, and file permissions. Pin the binary and run a fixture-based PDF regression test in deployment.
Remote assets time out or disappear
Test the URL from the conversion host, inspect redirects and certificates, provide required headers or cookies through supported settings, and avoid expiring signed URLs. A browser session that is already authenticated does not transfer automatically to wkhtmltopdf.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Performance, reliability, and cost considerations
Large SVGs, high-resolution nested images, filters, and remote dependencies increase conversion time and memory use. Simplify artwork where possible, cache or serve stable assets locally, and keep a timeout appropriate to your largest document. Do not hide failures by treating every PDF exit as success: retain stderr, inspect output size, and add visual checks for critical graphics.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
For repeatable builds, store a minimal fixture for each supported SVG pattern and run it whenever the binary, base image, fonts, or command options change. A successful PDF in one historical issue environment is not a guarantee for your version.
Or skip the browser setup
If your goal is a clean screenshot or PDF of a web page rather than debugging wkhtmltopdf’s legacy SVG engine, ScreenshotNeo makes one API request and handles the capture service for you. It accepts cookie and consent banners before capture, removes more than 60 known consent platforms plus newsletter popups and chat widgets, and lets you turn each cleanup step off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.
All features are included on every plan: full-page and element capture, device presets or custom viewports, dark mode, retina scale, PDF paper and margin controls, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, selectable TTL caching, signed image links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage data, and an OpenAPI specification. Parameters used by other screenshot APIs are accepted to ease migration. The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. See the ScreenshotNeo documentation for request options.
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}`);
Create a free ScreenshotNeo account to use the 1,000 monthly shots with no card.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchFAQ
Does converting the JPEG inside the SVG to base64 always fix the PDF?
No. Issue #2996 reports that base64 did not resolve the failure in its specific wkhtmltopdf 0.12.3 patched-Qt setup. It can remove one file-access dependency, but it cannot add unsupported renderer behavior.
Should I upgrade wkhtmltopdf to 0.12.6?
Record and test the exact build rather than assuming an upgrade resolves SVG issues. The documentation identifies 0.12.6 with patched Qt, while historical reports used other environments.
Is Qt 6 documentation proof that wkhtmltopdf supports a feature?
No. Qt 6 documentation describes current Qt vector support; wkhtmltopdf uses an older Qt WebKit stack, so treat it as background rather than a compatibility specification.
Frequently Asked Questions
Can I use an SVG as a CSS background in wkhtmltopdf?
Test it separately from an HTML img. CSS background loading adds another resolution path, so verify the URL and local-file policy in the exact conversion environment.
What should I preserve when simplifying an SVG?
Keep the namespace, dimensions, viewBox, and one nested image. Remove one class of complexity at a time so you can identify whether the failure is caused by access, sizing, or a specific SVG feature.
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.

