Use --window-status when your page can signal that its required asynchronous content is ready: set window.status to a distinctive value after rendering, then tell wkhtmltopdf to wait for that value. For a simpler, approximate pause, use --javascript-delay with a duration in milliseconds. JavaScript is enabled by default in the documented command-line tool.
Choose a readiness strategy
| Option | What triggers PDF rendering | Best for | Important limitation |
|---|---|---|---|
--window-status <value> |
window.status equals the supplied value |
Pages you control that can mark readiness after their required asynchronous work | The documentation does not specify a universal timeout if the value never appears. |
--javascript-delay <msec> |
The configured time elapses after page load | Pages whose rendering time is predictable enough for a bounded pause | A delay is not proof that application work finished. Too short may capture incomplete content; too long wastes time. |
The wkhtmltopdf usage documentation gives a default JavaScript delay of 200 ms. That is a default configuration value, not a guarantee that a particular page’s scripts or data requests will finish within that time. See the wkhtmltopdf usage documentation.
Wait for an explicit page-ready signal
If you can change the source page, set a distinctive status value only after the data and DOM updates needed in the PDF are complete. Then pass exactly the same value to --window-status.
<script>
// Set this only after the asynchronous work required in the PDF is complete.
window.status = 'pdf-ready';
</script>
wkhtmltopdf --window-status pdf-ready input.html output.pdf
Place the assignment at the real end of the work you need to capture—not simply in an early page-load handler if later requests or rendering steps still matter. If a script controls the asynchronous work, set the marker after it has updated the page.
#1 Best Overall
- 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.
Do not pass --disable-javascript when relying on page JavaScript to assign the status. The documented command-line tool enables JavaScript by default; disabling it prevents the page script from running.
Use a fixed delay when a signal is unavailable
For a page that you cannot modify, or one without a reliable readiness marker, specify an elapsed wait in milliseconds:
Rank #2
- Mix an audio, music and voice tracks
- Record single or multiple tracks simultaneously
- Intuitive tools to split, trim, join, and many other editing features
- Loaded with audio effects including EQ, compression, reverb, and more.
- Load an audio file and export to all popular audio formats from studio quality wav to high compression formats
wkhtmltopdf --javascript-delay 2000 input.html output.pdf
This example waits 2,000 ms after page load. Choose a duration based on the page’s observed behavior and allow for normal variation. A fixed pause can reduce premature captures, but it cannot tell whether an application-specific request failed, took unusually long, or has not yet updated the DOM.
Library configuration
For the libwkhtmltox interface, the analogous setting is load.jsdelay, which controls waiting after page load. JavaScript enablement is configured with web.enableJavascript. The library documentation also describes printing when JavaScript calls window.print(); this is distinct from using a ready marker in the command-line interface. See the libwkhtmltox page settings reference.
Rank #3
- 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
Do not treat combined options as a universal contract
The official option descriptions do not establish how --javascript-delay and --window-status interact when used together, nor do they specify a universal timeout for an unmet status value. A historical report for wkhtmltopdf 0.12.2.1 says the reporter observed the longer wait when combining the options, but that observation is not a cross-version guarantee. Prefer one clear readiness strategy, then validate the exact binary and input page you deploy. See the historical issue report.
Likewise, --run-script runs extra JavaScript after the page is done loading, according to the usage documentation; it is not documented as waiting for your application’s asynchronous work to finish. See the usage reference.
Rank #4
- Simple shift planning via an easy drag & drop interface
- Add time-off, sick leave, break entries and holidays
- Email schedules directly to your employees
Troubleshoot waits that finish too early or never finish
- The PDF misses dynamic content: A short fixed delay may have elapsed before rendering completed. Increase it with
--javascript-delay, or use a page-controlled status marker set after the required data and DOM updates. - The command appears to wait indefinitely: Check that the page actually assigns the exact string passed to
--window-status, and that JavaScript is enabled. The documentation does not promise a general timeout if the marker is never set. - The status option seems ignored: Record the exact wkhtmltopdf version and build, command and option placement, and whether the input contains a table of contents or multiple page objects. Historical issue reports describe context-sensitive outcomes, including a 0.12.3 setup involving a table-of-contents object; these reports identify things to check, not universal behavior. See the 0.12.2.1 report and 0.12.3 report.
- The page marker appears but content is still absent: Move the assignment until after the specific asynchronous operation and DOM update required by the PDF. A marker set too early is a false readiness signal.
- The delay works inconsistently: A fixed duration is sensitive to variation in page loading and rendering. Use an explicit status signal if you can add one; otherwise select a delay with margin based on the page’s observed behavior.
The wkhtmltopdf repository is archived, and the cited documentation and historical reports do not establish behavior for every executable or a currently supported release. Validate the command against the exact build and page structure you intend to use.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If you need a screenshot or PDF without managing a local browser-rendering wait, ScreenshotNeo provides a website screenshot API and MCP server. Its API accepts one GET request for an image or PDF, and the API documentation is at screenshotneo.com/docs.
Best Value
- Intuitive interface of a conventional FTP client
- Easy and Reliable FTP Site Maintenance.
- FTP Automation and Synchronization
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter popups and chat widgets before capture; bot checks, blank pages and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for the free plan.
Frequently Asked Questions
What unit does –javascript-delay use?
Milliseconds.
Does wkhtmltopdf enable JavaScript by default?
Yes, in the documented command-line tool.
What if the page never sets the requested window.status value?
The documentation does not specify a universal timeout. Ensure the page assigns the exact value and validate behavior with your deployed executable.
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.




