What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Stop the hang at the navigation stage, not inside PDF writing. First identify your converter, set an explicit readiness condition, impose a finite timeout, and cancel or handle the failed navigation before calling the PDF method. Playwright, Puppeteer, and wkhtmltopdf expose different controls, so a setting for one will not fix another.
1. Identify what is actually waiting
An HTML-to-PDF job has two distinct phases:
- Navigation and page preparation: the engine requests the document, runs scripts, loads styles, fonts, images and other resources, and waits for your readiness rule.
- PDF generation: the engine serializes the prepared page. Puppeteer’s documentation notes that, by default,
Page.pdf()waits for fonts to load.
A conversion that never reaches the PDF call is a navigation/readiness problem. A conversion that reaches the call and then fails needs PDF-specific diagnostics. Record the converter name, version, target URL, exact exception, and the last phase reached before changing settings.
2. Choose what “ready” means
There is no universal signal that a modern page is finished. A news feed, dashboard, or chat application may continue making requests forever. Select the earliest condition that guarantees the content you need.
Playwright navigation states
commit: the response has been committed and the document begins loading.domcontentloaded: the initial HTML has been parsed.load: the page’s load event has fired.networkidle: no network connections for the required idle window. Playwright discourages using this as a general readiness test; pages with polling or analytics may never become idle.
For reliable PDFs, prefer a domain-specific assertion such as a report heading, table row, or “Ready” marker after navigation. Use networkidle only when you control the page and know its requests stop.
#1 Best Overall
- 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
Puppeteer readiness
Puppeteer navigation accepts a waitUntil condition. Navigate with the condition that matches your page, then wait for a selector or application signal before calling page.pdf(). This keeps a slow third-party image from deciding whether your report is ready.
wkhtmltopdf readiness
wkhtmltopdf uses command-line load and script settings rather than a Playwright-style navigation event. Its load-error mode determines whether a page-load failure aborts, is ignored, or is skipped. A JavaScript delay or slow-script setting affects script execution after loading; neither substitutes for diagnosing a DNS, TLS, authentication, or blocked-resource failure.
3. Playwright: timeout and cancellation
Playwright navigation has a configurable timeout and accepts an AbortSignal. The documented default navigation timeout is zero, meaning no limit unless you configure one. Set a finite limit for every unattended job, catch the thrown error, and make the caller mark the job failed or retry it.
Rank #2
- 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.
Node.js example with a readiness assertion
import { chromium } from 'playwright';
const browser = await chromium.launch();
const context = await browser.newContext();
const page = await context.newPage();
page.setDefaultNavigationTimeout(30_000);
const controller = new AbortController();
const cancelTimer = setTimeout(() => controller.abort(), 35_000);
try {
await page.goto('https://example.com/report', {
waitUntil: 'domcontentloaded',
signal: controller.signal
});
await page.locator('[data-report-ready="true"]').waitFor({ timeout: 10_000 });
await page.pdf({ path: 'report.pdf', format: 'A4', printBackground: true });
} catch (error) {
console.error('Navigation or PDF generation failed:', error.message);
// Do not call page.pdf() again until the page has been diagnosed or reloaded.
} finally {
clearTimeout(cancelTimer);
await browser.close();
}
If the page has no reliable marker, use load or domcontentloaded and a bounded, page-specific wait. Avoid an unbounded wait for network idle. Configure the timeout at page, context, or browser level so a forgotten page cannot hold a worker indefinitely.
When to abort versus retry
- Abort immediately: invalid URL, authentication failure, certificate error, or a deterministic 4xx response.
- Retry with backoff: transient DNS errors, 5xx responses, or a temporarily unavailable dependency.
- Capture diagnostics: save the URL, response status, console errors, failed-request URLs, and a screenshot or trace before discarding the page.
4. Puppeteer: separate navigation from page.pdf()
Runnable Node.js example
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const page = await browser.newPage();
page.setDefaultNavigationTimeout(30_000);
try {
await page.goto('https://example.com/report', {
waitUntil: 'domcontentloaded',
timeout: 30_000
});
await page.waitForSelector('[data-report-ready="true"]', {
visible: true,
timeout: 10_000
});
await page.pdf({
path: 'report.pdf',
format: 'A4',
printBackground: true,
timeout: 30_000
});
} catch (error) {
console.error('Conversion failed:', error.message);
} finally {
await browser.close();
}
Use waitUntil: 'load' when the document’s load event is meaningful. Use domcontentloaded when your own selector or script determines readiness. Do not assume that calling page.pdf() cancels a navigation that is still pending; make navigation bounded and handle its error first.
Fonts and apparently stalled PDFs
Puppeteer says that Page.pdf() waits for fonts by default. A web font whose server is unreachable can therefore make the PDF phase appear stuck even after navigation. Check font requests and cross-origin permissions, or serve a dependable font and set a PDF timeout. Do not “fix” a font failure by shortening the navigation wait; those are different phases.
Rank #3
- 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.
5. wkhtmltopdf: select the load-error policy
wkhtmltopdf’s --load-error-handling option accepts abort, ignore, or skip; abort is the documented default.
| Setting | Effect | Use when |
|---|---|---|
abort |
Fail the conversion when the page cannot load. | The PDF must be complete and a partial document is unsafe. |
ignore |
Continue despite the page-load error. | The missing resource is known to be nonessential and you will inspect output. |
skip |
Skip the problematic page and continue. | Batch jobs can accept a missing page and report it separately. |
Media failures are controlled separately by --load-media-error-handling, whose documented default is ignore. Changing media handling does not change what happens when the HTML page itself fails.
Commands
# Strict: fail on a page-load error (the documented default)
wkhtmltopdf --load-error-handling abort https://example.com/report report.pdf
# Continue when a noncritical page-load error occurs
wkhtmltopdf --load-error-handling ignore https://example.com/report report.pdf
# In a multi-page job, skip a failed page
wkhtmltopdf --load-error-handling skip input.html report.pdf
wkhtmltopdf also provides a JavaScript delay and a setting to stop slow scripts. Use those only after confirming that scripts, rather than network navigation, are the cause. A longer delay cannot repair a blocked host or invalid certificate.
Rank #4
- 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
6. A diagnostic workflow that prevents infinite jobs
- Reproduce outside the PDF call. Navigate to the URL and log the response status, redirects, console errors, and failed requests.
- Test the URL from the conversion host. Check DNS, outbound firewall rules, proxy settings, TLS certificates, and authentication. A page that works on your laptop may be unreachable from a worker.
- Disable only the suspect dependency. Block a known analytics or advertising host temporarily, but do not hide a required API failure.
- Use a bounded readiness rule. Set a navigation timeout and a shorter selector/assertion timeout. Never let the default zero timeout govern a production queue.
- Capture evidence on failure. Store the final URL, status, error text, console output, and a diagnostic screenshot or HTML snapshot.
- Choose a recovery policy. Retry transient failures with a limit; fail deterministic errors quickly; report skipped pages explicitly in batch output.
7. Common symptoms and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| Navigation waits forever | No timeout configured, or the page never reaches the chosen state. | Set a finite timeout; use domcontentloaded plus a readiness selector instead of universal network idle. |
| Timeout occurs during PDF creation | Fonts or print resources are still loading. | Inspect font requests, verify access from the worker, and set a PDF timeout. |
| Blank or partial PDF | Conversion began before application data rendered. | Wait for a real report marker, not merely a browser event. |
| wkhtmltopdf exits on one broken image | Page-load and media policies are being confused. | Keep --load-error-handling for the document and configure --load-media-error-handling separately. |
| JavaScript delay changes nothing | The failure is DNS, TLS, authentication, or a blocked request. | Inspect network and response errors; delay only addresses script timing. |
| Retries fail identically | The error is deterministic, such as a bad URL or missing credentials. | Stop retrying, correct configuration, and preserve the original error. |
8. Performance, reliability, and cost decisions
Shorter waits are not automatically faster: starting PDF generation before data is ready creates retries and unusable files. A practical policy is a finite navigation budget, a separate readiness budget, and one or two retries only for errors classified as transient. Reuse a browser process where safe, but create an isolated context per job so cookies and pages do not leak between customers. Limit concurrency to the CPU and memory available for rendering; otherwise queue time and timeout frequency rise together.
For batch conversion, record one result per URL: success, skipped, failed, or timed out. Treat a partial batch as an operational error even when the process exits successfully. Keep the original HTML or a diagnostic artifact for failures so a later retry can distinguish a changed page from a changed converter.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.9. Or skip the browser setup
ScreenshotNeo provides a website capture API and MCP server. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing result.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteFor a one-call capture, see the ScreenshotNeo documentation:
Best Value
- 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
ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The service includes full-page and element capture, custom waits, headers and cookies, JavaScript, PDF controls, async jobs, bulk capture, caching, and an OpenAPI specification. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
10. Final checklist
- Name the converter and record its version and exact error.
- Define readiness with a selector or application signal where possible.
- Set finite navigation and PDF timeouts.
- Use abort signals or process cancellation for jobs that exceed their budget.
- Keep page-load and media-error policies separate in wkhtmltopdf.
- Capture diagnostics before retrying, and classify failures as transient or deterministic.
Frequently Asked Questions
Should I always use network idle before creating a PDF?
No. Playwright specifically discourages network idle as a universal readiness check. Use a page-specific assertion when the application provides one.
What is the safest wkhtmltopdf setting for important documents?
Keep --load-error-handling abort when a missing page must invalidate the document; choose ignore or skip only when your workflow explicitly accepts incomplete output.
Outdated 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 matchWindows 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 reinstallWhy does a PDF call wait when navigation already finished?
PDF generation can still wait for fonts and print resources. Inspect those requests and apply a separate PDF timeout.
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.

