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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

If an OpenLayers 3 map is blank, missing tiles, or only partly drawn in a wkhtmltopdf PDF, first make the render reproducible: use the Canvas renderer where your OpenLayers version supports it, keep JavaScript enabled, allow time for the map and its assets to load, and set a stable viewport and map size. Then verify that every script, stylesheet, icon, and tile is reachable by the wkhtmltopdf process. These steps can address timing and configuration problems, but they cannot make wkhtmltopdf’s old Qt WebKit engine support browser features it does not implement.

Why OpenLayers 3 can fail in wkhtmltopdf

OpenLayers 3 can render with more than one technology, including DOM, Canvas, and WebGL. wkhtmltopdf, by contrast, renders pages using Qt WebKit, an old browser engine. A map that works in a current desktop browser may depend on JavaScript behavior, rendering paths, or browser APIs that the embedded engine handles differently or not at all.

The failure can look like a rendering bug even when the map code itself is sound. A zero-sized map container, late tile responses, blocked local files, or a viewport different from the one expected by the page can each leave the PDF blank or incomplete. OpenLayers’ upgrade notes also document changes to renderer availability, including removal of the DOM renderer and Canvas fallback behavior in later versions. Check the documentation for the exact OpenLayers release in use rather than assuming every renderer option is available in every OpenLayers 3 build.

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

The wkhtmltopdf project status page says Qt 4 has been unsupported since 2015 and that its WebKit has not been updated since 2012. It advises considering Puppeteer or a wrapper for sites that use dynamic JavaScript. That makes targeted compatibility fixes worth trying for a stable legacy page, but repeated failures around modern browser features are a reason to change renderers, not just keep increasing the delay.

#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Start with a reproducible baseline

Record the binary and environment

Before changing the map, capture the exact command-line version and the environment that runs it. A command such as wkhtmltopdf --version identifies the reported build. Also note the operating system and version, how the binary was installed, whether it is a patched-Qt build, and whether the input is a URL or a local HTML file. The official downloads information distinguishes the stable 0.12.6 series, released June 11, 2020, from distribution packages; build differences can affect available settings and behavior.

Keep the original command and output. Run the same input under the same account and network conditions as the production job. A map loading in your interactive browser is not proof it will load from a headless process with different filesystem permissions, DNS, proxy, or authentication.

Prove the map works in the exact input

  1. Open the exact URL or HTML file in a normal browser and confirm the map is visible.
  2. Inspect the map container before the map is constructed. It needs a non-zero width and height; set those dimensions explicitly while debugging.
  3. Run the same input through wkhtmltopdf with JavaScript warnings enabled using the load.debugJavascript library setting. Inspect the process output for JavaScript errors and failed requests.
  4. Reduce the page to a map with one base layer and one vector layer. Add controls, labels, custom projections, and overlays one at a time.

This baseline separates a map-code problem from an engine limitation, a network or asset problem, and a print-layout problem.

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

Use a renderer the embedded browser can handle

For an OpenLayers 3 release that supports it, test the Canvas rendering path rather than relying on DOM or WebGL rendering in wkhtmltopdf. Renderer configuration is version-sensitive, so confirm the option against the API documentation for your installed release. In versions where the map constructor accepts a renderer option, the configuration is typically expressed as renderer: 'canvas' in the map options; verify that exact spelling and support against the version you ship.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Do not treat Canvas as a universal fix. It cannot correct a JavaScript exception that prevents map initialization, an inaccessible tile server, a zero-height container, or a missing feature in Qt WebKit. If the map only works with WebGL or another unsupported browser capability, use a different PDF renderer.

Make map readiness and JavaScript timing predictable

JavaScript is enabled by default in typical wkhtmltopdf use, but confirm it has not been disabled in your command or library configuration. The official page-settings reference names web.enableJavascript and load.jsdelay; the command-line equivalent for waiting after page load is --javascript-delay.

For diagnosis, choose a delay long enough for map initialization, tile requests, and vector drawing, then compare the resulting PDF. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wkhtmltopdf --enable-javascript --javascript-delay 5000 https://your-public-map-page/ map.pdf

The URL above is illustrative: substitute the actual page URL. A fixed delay is a baseline, not proof that the map is ready. Slow tile services can exceed it, while a long delay cannot repair a script that failed. In an application you control, prefer an explicit readiness signal that becomes true after the map is initialized and the required layers have rendered; arrange for the capture process to wait on it if your chosen renderer supports that workflow. wkhtmltopdf’s documented delay is time-based, so test it under realistic network conditions.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Check every asset from the renderer’s point of view

OpenLayers needs its JavaScript and stylesheets, and a map may also depend on icons, sprites, fonts, and remote or local tiles. Verify those requests from the machine and execution context running wkhtmltopdf. Check that URLs resolve, TLS connections succeed, credentials are present where required, and any proxy or network policy allows the requests. A missing tile or sprite can resemble a renderer failure.

For local assets, inspect load.blockLocalFileAccess, the documented setting that controls whether local and piped input files can access other local files. If the page references local scripts, styles, or images, confirm the configuration permits the intended access. Do not broadly expose filesystem access for untrusted input as a workaround: the wkhtmltopdf project warns against processing untrusted HTML.

For remote assets, verify that the URLs are directly accessible to the wkhtmltopdf process; an asset that loads only in an authenticated browser session may not load in the converter. CORS is not necessarily the only or primary issue for an image or tile request, so inspect the actual browser warnings and process output rather than changing server policy blindly.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Stabilize the viewport and print layout

The map’s layout may differ at PDF capture time from what you see in a browser window. The documented screenWidth setting controls the page width used for rendering. Set a deliberate viewport equivalent for your build, and give the map element explicit dimensions in CSS. Use a print stylesheet that prevents surrounding layout rules from collapsing or clipping the map.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Temporarily disable intelligent shrinking while diagnosing. The page/image settings document this behavior; on builds that expose the command-line option, use --disable-smart-shrinking. This is a diagnostic measure, not a guaranteed fix: changing scale can alter the visible map area but cannot make missing tiles or unsupported JavaScript appear.

wkhtmltopdf --enable-javascript --javascript-delay 5000 --viewport-size 1280x800 --disable-smart-shrinking https://your-public-map-page/ map.pdf

Check your installed build’s help and settings support before relying on a flag: patched-Qt and distribution builds can differ. Once the failure is understood, re-enable only the layout behavior that your output actually needs.

Isolate the failing part of the map

  1. Start with one base layer and a fixed-size map container.
  2. Confirm the base tiles appear in the PDF before adding application layers.
  3. Add a single vector layer and confirm its features draw.
  4. Reintroduce controls, labels, overlays, and custom projections one at a time.
  5. Compare output at a fixed viewport with and without intelligent shrinking.

If the base tiles fail but vectors work, investigate tile URL access, authentication, TLS, and timing. If tiles appear but vectors do not, focus on the vector source, projection, renderer path, and JavaScript errors. If both render in a browser but neither appears in the PDF, check container dimensions, JavaScript execution, asset access, and engine compatibility before making more map changes.

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

Troubleshooting common failures

Symptom Likely cause What to check or change
Entire map area is blank JavaScript did not initialize, the container has no size, or the engine hit an unsupported API. Check load.debugJavascript output; set explicit container dimensions; test a minimal map and the Canvas path supported by your version.
Map appears, but some tiles are missing Capture occurred before requests finished, or the converter cannot reach particular tile URLs. Increase the diagnostic delay, inspect failed requests, and check DNS, TLS, authentication, and network access from the converter host.
Scripts, styles, icons, or local tiles disappear Local-file access restrictions or incorrect asset paths. Inspect load.blockLocalFileAccess and validate paths relative to the input file; grant only the access needed for trusted input.
PDF map is clipped, too small, or laid out differently Unexpected viewport width, CSS print rules, or intelligent shrinking. Set screenWidth, use fixed map dimensions and a stable print stylesheet, then temporarily disable shrinking to compare.
Longer delays do not help The page has a JavaScript error, a missing asset, or a browser feature wkhtmltopdf does not support. Read debug output and reduce the page to a minimal reproduction. If it relies on modern APIs, migrate to a maintained renderer instead of extending the wait.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When to move from wkhtmltopdf

Try the compatibility steps when the page is stable and the problem is demonstrably timing, access, or layout. Move to a maintained browser automation renderer when the map depends on modern syntax, promises, fetch, ES modules, WebGL, or other browser APIs that the Qt WebKit build cannot provide reliably. The wkhtmltopdf project status page explicitly points dynamic-JavaScript users toward Puppeteer or similar wrappers.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Compare alternatives on JavaScript/API compatibility, repeatability of page readiness, tile and asset loading, security maintenance, deployment footprint, font handling, and operational support. A newer engine is not automatically a drop-in replacement: test the same HTML, required fonts, map layers, and PDF layout before switching production jobs. For untrusted HTML, treat renderer isolation and filesystem/network permissions as part of the decision, not as an afterthought.

Or skip the browser setup

If you need a quick visual capture of a public map page while diagnosing it, ScreenshotNeo is a screenshot API and MCP server. Its one-call API can return a screenshot or PDF; the example below saves the default screenshot response as a WebP file. Replace the example URL with your reachable map page. See the ScreenshotNeo API 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

ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server includes take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots.

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

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

What to include in a useful bug report

If the problem persists, the wkhtmltopdf Reporting Issues guidance asks for the version, operating system and version, a detailed description, and a minimal HTML/CSS/JavaScript test case that reproduces the issue. Include the exact command or library settings, whether the input is local or remote, and relevant stderr output. A small case with one base layer and one vector layer is more actionable than an entire application that obscures which request or render step failed.

Frequently Asked Questions

Does a successful browser preview prove wkhtmltopdf can render the map?

No. The browser and wkhtmltopdf use different rendering engines and may have different access to network resources and local files.

Should I keep increasing the JavaScript delay until the PDF works?

Only use a longer delay to test whether the page needs more time. If logs show script errors or unsupported browser APIs, a delay will not resolve the underlying incompatibility.

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

Can I safely enable local-file access for every conversion?

Avoid doing so for untrusted HTML. Limit filesystem access to the trusted files required by the conversion.

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.