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.

Google Charts can appear in a wkhtmltopdf PDF only if the page’s JavaScript runs, the chart’s scripts and data load, and the chart finishes drawing before the PDF is captured. Start by confirming the chart works in a browser, then enable JavaScript in wkhtmltopdf and wait for an application-defined ready signal. A fixed delay may help diagnose timing problems, but it is not a reliable universal fix: compatibility depends on the chart, page, network, and wkhtmltopdf build.

Why Google Charts can be missing from a PDF

Google Charts is a JavaScript API that renders charts using HTML5 and SVG technologies. wkhtmltopdf converts HTML to PDF using Qt WebKit. For a chart to appear, that rendering engine must execute the page’s JavaScript, retrieve the chart library and any data, complete drawing, and capture the resulting page afterward.

A blank chart area can therefore have several causes: the page itself did not draw the chart; JavaScript was disabled; the chart or data request did not finish before capture; a remote resource could not be reached; a script error stopped rendering; or the browser engine could not support something the page requires. A PDF is a static snapshot, not an interactive chart page.

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.

Check the page before changing wkhtmltopdf

  1. Open the exact HTML page in a supported browser. Confirm the chart appears with the same URL, data, authentication and network conditions used in the PDF workflow. If it is blank there too, fix the page or its data source first.
  2. Check how the chart becomes ready. Identify the page-side callback or other application state that indicates the data loaded and drawing completed. A script merely being present is not proof that the chart has finished.
  3. Check the resources and errors. Verify that the chart library and data endpoint are reachable from the machine producing the PDF. Look for JavaScript errors, blocked requests, authentication failures, and network delays.
  4. Record the actual wkhtmltopdf binary and build. Behavior can vary by build and distribution. Do not assume that a command working on one machine will behave identically in another.

Enable JavaScript and wait for chart drawing

The wkhtmltopdf command-line manual documents JavaScript execution and wait controls, including --enable-javascript, --javascript-delay, and --window-status. Use them as tools for controlling execution and capture timing—not as a way to add modern browser capabilities that the engine does not have.

Try a delay as a diagnostic

A basic test can enable JavaScript and allow extra time before capture:

wkhtmltopdf --enable-javascript --javascript-delay 5000 input.html output.pdf

Here, the delay is five seconds. It is only an example value, not a recommended universal setting. Library downloads, data-source latency and chart rendering time vary; a longer wait can make a slow page appear to work while still failing intermittently on slower runs. Use a delay to test whether capture is happening too early, then prefer a readiness condition when you control the page.

Prefer an application-defined window status

The manual also documents --window-status, which waits until the page’s window status matches a supplied value. Your page must set that status only after the chart is actually ready. The exact signal is application-specific; the following illustrates the pattern, not a drop-in Google Charts callback for every page:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
// In the page, after the chart's completion callback confirms drawing is done:
window.status = 'charts-ready';
wkhtmltopdf --enable-javascript --window-status charts-ready input.html output.pdf

Connect the status update to the chart’s real completion path, including data loading where applicable. Setting it as soon as the page loads, or before an asynchronous data request completes, defeats the purpose. If the page can fail to reach the ready state, test how your installed build handles that condition and set an operational timeout in the surrounding job system.

Compatibility: timing controls cannot modernize Qt WebKit

The wkhtmltopdf downloads page lists 0.12.6 as the stable series and gives its release date as June 11, 2020. That age makes compatibility with current browser APIs a risk to verify against the actual page; it does not establish that every Google Chart will fail. Check the release and distribution status relevant to your deployment rather than assuming parity with current Chrome.

A historical wkhtmltopdf issue records Google Maps rejecting wkhtmltopdf 0.12.5 and older after a browser-support change in November 2018. That issue is about Google Maps, not a controlled test of Google Charts, so it is an adjacent warning about browser compatibility—not evidence of a specific Charts error. Do not diagnose a Google Chart failure by treating the Maps issue title, “Google Maps JavaScript API does not support this browser,” as the chart’s own message.

Choose a dependable fallback when the chart still fails

If the chart cannot reliably draw in the installed renderer, choose a fallback based on whether JavaScript must run during PDF creation, the fidelity you need, and what your deployment can support. These are trade-offs, not benchmarked rankings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Approach JavaScript during PDF capture? Best fit Trade-offs to assess
Keep wkhtmltopdf and fix timing or page compatibility Yes, for a live Google Chart Existing deployments where the page works with the installed engine Build compatibility, remote access, asynchronous readiness and repeatability
Render a chart image before PDF generation No chart drawing during PDF capture Static reports where the chart’s data is available to a separate rendering step Image fidelity at the PDF size, output resolution, and how the image-generation step is deployed and maintained
Use a browser-based PDF workflow Typically, if it loads the page and chart in a browser runtime Pages that require a more modern browser engine Browser runtime and deployment footprint, page readiness, resource access, and compatibility maintenance

For an image fallback, generate the chart image only after the data and drawing step are complete, then insert that image into the HTML sent to wkhtmltopdf. This removes chart execution from the PDF step, but you must ensure the image has adequate dimensions for its printed size and that the PDF job can access it. For a browser-based renderer, test the same page, data, authentication and network conditions as production; the available project documentation does not establish one universally best alternative.

Security and deployment checks

The wkhtmltopdf downloads page warns against using the tool with untrusted HTML and says user-supplied HTML or JavaScript must be sanitized because unsafe input can compromise the server. Treat PDF generation as a security boundary: do not render arbitrary submitted markup or scripts with access to the production environment. Limit what the rendering process can reach and handle input according to your application’s threat model.

Also verify whether the project and the particular package you deploy remain suitable for your maintenance requirements. The downloads page dates the 0.12.6 stable series to 2020; the cited historical issue page says the repository was archived in January 2023. Distribution and maintenance status can change, so check the project’s current official pages before adopting or upgrading a build.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If the job is to capture a rendered website rather than produce a custom PDF pipeline, ScreenshotNeo offers a website screenshot API and MCP server. It returns PNG, JPEG or WebP screenshots, or a PDF, from one GET request. For example, this cURL call captures a page as WebP:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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 parameters and setup. Cookie and consent banners are accepted before capture, and known consent platforms, newsletter popups and chat widgets are removed; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and response headers indicate the page verdict and billing status. Its MCP server includes take_screenshot, get_page_info and capture_pdf tools for AI agents and MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

Troubleshooting common failures

Symptom Likely cause What to check or change
Chart is blank in both browser and PDF Page script, data, or chart setup is failing independently of PDF conversion Inspect browser errors and the data request; confirm the page renders before testing wkhtmltopdf.
Chart works in browser but is absent in PDF JavaScript is disabled, capture is too early, a resource is inaccessible to the job, or the engine is incompatible Enable JavaScript, test a delay, then use a readiness signal. Check resource access and the exact binary/build.
Longer delay fixes some runs but not others Variable library, data, or rendering time Replace guessed timing with a page status set on actual completion; investigate slow or failing requests.
Readiness wait never completes The page never sets the expected status, often because an earlier script or data request failed Confirm the exact status string and that every success path reaches it; inspect JavaScript errors and endpoint responses.
Page fails only under wkhtmltopdf Remote access, authentication, browser-engine support, or runtime differences Reproduce the request from the PDF host, verify credentials and network rules, and test whether the page needs browser features the build lacks.
User-provided HTML is involved Untrusted scripts or markup may expose the server to compromise Do not pass unsanitized content to wkhtmltopdf; follow the project’s security warning and isolate the rendering workflow.

Frequently Asked Questions

Does `–javascript-delay` guarantee that Google Charts will render?

No. It waits a fixed duration, while library loading, data retrieval and drawing time can vary. Prefer a page status tied to chart completion when you control the page.

Does the Google Maps browser-support issue prove Google Charts is incompatible?

No. The historical issue concerns Google Maps and is only an adjacent warning about browser-engine compatibility.

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.

Can wkhtmltopdf make an interactive chart in the PDF?

A PDF capture is a static page snapshot. It does not preserve the live JavaScript chart as an interactive web page.

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.