October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober 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

Why wkhtmltopdf Produces a Blank Page for JavaScript Websites—and How to Fix It

A blank wkhtmltopdf PDF is not always a timing problem. Check scripts, page resources, and application readiness before deciding whether the Qt WebKit renderer can handle the site.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A blank PDF from a JavaScript-driven site usually means wkhtmltopdf printed before the page was ready, could not load or run something the page needs, or encountered a browser feature its Qt WebKit engine does not support. Start by checking the exact command, JavaScript errors, and resource access; then use a readiness signal rather than relying on an arbitrarily long delay. If the page still fails after those checks, render it with a modern browser engine such as Playwright.

Why JavaScript pages can come out blank

wkhtmltopdf converts HTML to PDF using Qt WebKit. JavaScript is enabled by default, but the documented --javascript-delay is only 200 milliseconds by default. That is a timer, not a guarantee that a single-page application has fetched data, mounted its content, or finished drawing.

As an Amazon Associate I earn from qualifying purchases.

A blank output does not identify its own cause. The HTML may be empty, a script may have failed, an API or asset may be unreachable from the machine running wkhtmltopdf, a redirect or cookie requirement may block the page, or the installed WebKit build may not support a browser feature the site requires. Diagnose the actual failure before changing flags.

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

Diagnose the failure in order

1. Capture the exact environment and command

Record the complete command, the output of wkhtmltopdf --version, the operating system and version, and a small reproducible HTML/JavaScript example if possible. These details help distinguish a site-specific issue from a build or environment issue; the project asks for version, OS, and a detailed test case when reporting problems.

#1 Best Overall
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
  • Convert your PDF files into Word, Excel & Co. the easy way
  • Convert scanned documents thanks to our new 2022 OCR technology
  • Adjustable conversion settings
  • No subscription! Lifetime license!
  • Compatible with Windows 11, 10, 8.1, 7 - Internet connection required

2. Check that JavaScript is enabled and inspect errors

JavaScript is on by default, but confirm your command or wrapper has not disabled it. Add --debug-javascript and inspect standard error for script errors or other clues. A script error can prevent the application from inserting the content that the PDF is expected to contain.

3. Verify the page and its dependencies from the rendering machine

Check that the page’s main content exists in the HTML or DOM and that the renderer can access everything needed to display it. This includes scripts, stylesheets, fonts, images, API endpoints, cookies, and redirects. A URL that works in your desktop browser may behave differently in the server environment where wkhtmltopdf runs.

4. Wait for meaningful readiness, not just elapsed time

If content appears after a known delay, test a modestly longer delay in milliseconds:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
  • Convert over 50 document file formats.
  • Preview your files from Doxillion before converting them.
  • Use batch conversion to convert thousands of files at once.
  • Enjoy an easy-to-use, intuitive interface with a Drag and Drop file option.
  • Burn your converted or original files directly to disc.

wkhtmltopdf --javascript-delay 1000 https://example.com output.pdf

Replace the example URL and output filename with yours. The manual documents --javascript-delay as waiting for JavaScript to finish, with a default of 200 milliseconds, but it remains a time-based wait. A longer timer can help when content is merely late; it cannot fix an incompatible script, blocked request, or page that never reaches its intended state.

When you control the page, a more reliable option is to set window.status to a known value only after the content needed in the PDF is ready, then wait for that value:

Rank #3
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
  • EDIT text, images & designs in PDF documents. ORGANIZE PDFs. Convert PDFs to Word, Excel & ePub.
  • READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.
  • CREATE, COMBINE, SCAN and COMPRESS PDFs
  • FILL forms & Digitally Sign PDFs. PROTECT and Encrypt PDFs
  • 1 Year License for 1 Windows & 2 Mobile (Android and/or iOS) devices.

wkhtmltopdf --window-status pdf-ready https://example.com output.pdf

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.

The application must actually set window.status = 'pdf-ready' when its content is ready. This flag is a documented wait mechanism, not a guarantee that every resource or layout is correct.

5. Do not treat ignored load errors as a repair

--load-error-handling ignore changes how load failures are handled; it does not make a failed page render successfully. Suppressing an error can still leave you with an empty document. Find the failed request or script instead.

Rank #4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
  • Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.
  • EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
  • READ and Comment on PDFs – Intuitive reading modes & document commenting and mark up tools!
  • CREATE, COMBINE, SCAN and COMPRESS PDFs.
  • FILL forms & Digitally Sign PDFs. Work with Digital certificates

When to switch to a modern browser renderer

The wkhtmltopdf project status account discusses the age of its WebKit1 foundation as historical context; it is not, by itself, a formal current end-of-life notice. If the page depends on browser APIs or JavaScript behavior unsupported by the Qt WebKit build you have, repeatedly increasing the delay is unlikely to solve the compatibility problem.

Move to a Chromium-based renderer when the page needs features absent from the installed engine, or when the same reproducible page remains blank after you have confirmed that resources load and the readiness condition is reached. Playwright’s page.pdf() can wait for a page-specific selector or condition before generating a PDF. Its documentation cautions against using networkidle as a general readiness test; assert the actual state your page needs instead. Playwright uses print CSS by default for PDF output, so verify print styles, headers and footers, fonts, and page breaks against the intended result. The available source documentation establishes these capabilities but provides no comparative benchmark results.

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

Or skip the browser setup

If your need is a screenshot rather than a scripted local PDF workflow, ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF. Its capture can accept consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before taking the shot; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. AI agents can use its MCP server tools, including take_screenshot, get_page_info, and capture_pdf.

For a PDF response, make a GET request to the API endpoint and use the documented PDF options as needed. The API parameter names used by other screenshot APIs also work, which can make switching easier. See the ScreenshotNeo documentation for setup and options.

Best Value
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
  • Convert over 50 document file formats.
  • Preview your files from Doxillion before converting them.
  • Use batch conversion to convert thousands of files at once.
  • Enjoy an easy-to-use, intuitive interface with a Drag and Drop file option.
  • Burn your converted or original files directly to disc.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The plans include 1,000 screenshots per month free with no card, then paid options starting at $5 for 3,000; every feature is on every plan. Sign up for free and get 1,000 screenshots a month with no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failure symptoms and fixes

  • Blank output despite a longer delay: Check JavaScript errors and failed dependencies, then verify the page’s actual ready state. A historical issue reports a blank white page even after increasing the delay, so a longer wait is not a universal fix.
  • It works locally but not on the server: Check server-side access to the page’s assets and APIs, along with cookies, redirects, and authentication requirements.
  • Output appears without expected content: Confirm that the content is in the DOM before printing and wait for an application-specific selector or status where possible.
  • Ignoring load errors changes nothing: Restore useful error reporting and identify the failed resource; suppressing a load error does not supply missing content.
  • The page relies on newer browser features: Confirm compatibility with the installed Qt WebKit build. If the feature is unsupported, use a modern browser renderer rather than tuning a timer.

What to include in a reproducible bug report

  • The exact wkhtmltopdf --version output and operating system/version.
  • The full command and whether it runs locally, in a container, or on a server.
  • A minimal page or test case that reproduces the blank output.
  • Relevant standard-error output from --debug-javascript and details of resources that fail to load.
  • The readiness mechanism and delay used, if any.

Frequently Asked Questions

Does wkhtmltopdf enable JavaScript by default?

Yes. Its documented command-line options enable JavaScript by default; check that your command or wrapper has not disabled it.

Does a blank PDF prove that a JavaScript delay is too short?

No. It can also result from script errors, inaccessible dependencies, redirects or cookies, or unsupported browser features.

Should I use networkidle as the PDF readiness condition in Playwright?

Playwright’s documentation discourages treating network idle as a general readiness signal. Wait for or assert the page state that matters to your output.

Quick Recap

Bestseller No. 1
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
Convert your PDF files into Word, Excel & Co. the easy way; Convert scanned documents thanks to our new 2022 OCR technology
Bestseller No. 2
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Convert over 50 document file formats.; Preview your files from Doxillion before converting them.
Bestseller No. 3
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.; CREATE, COMBINE, SCAN and COMPRESS PDFs
$83.88
Bestseller No. 4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.; EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
$99.99
Bestseller No. 5
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Convert over 50 document file formats.; Preview your files from Doxillion before converting them.

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
Windows Errors? Fix Them Before They SpreadFree repair scan

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.