Free tools Windows power users keep installed
One-click scans. No signup required.
Fix PDF page-load errors by separating navigation from rendering. First record whether the browser reached the URL and what response it received. Then verify that the fonts, images, scripts, API data and other resources required by the document loaded, wait for an application-specific ready signal, and only then tune print layout. Chrome Headless and Playwright provide the controls needed to identify each failure class.
What “page-load error” actually means
A PDF job can fail before a document exists, or it can produce a PDF after navigation technically succeeded. These are different problems and require different evidence.
- Navigation failure: an invalid URL, DNS or network outage, timeout, certificate error, or browser main-resource failure prevents the document from being obtained. Playwright’s
page.goto()can throw in these cases. - HTTP error response: a server can return a 404 or 500 response that Playwright still gives you for inspection. A response with an error status is not the same as a navigation exception.
- Subresource failure: the HTML arrives, but a stylesheet, font, image, JavaScript bundle, API request or iframe fails. The page may look incomplete or the PDF may be blank.
- Readiness failure: the page is reachable, but client-side rendering has not produced the heading, table, chart or invoice data that the PDF needs.
- Print-layout failure: the page is ready, but print CSS, paper size, margins, backgrounds or page ranges make the output appear clipped, unstyled or empty.
Capture a diagnostic record containing the original URL, redirect chain, final URL, response status, elapsed time, browser version, host or container, proxy settings and certificate mode. That record prevents a layout tweak from masking a network problem.
Use a minimal reproduction first
Start with a known-good page to determine whether the browser runtime works independently of your application.
#1 Best Overall
- INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
- LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
- COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
- ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
- HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs
chrome --headless --print-to-pdf https://developer.chrome.com/
Bound the capture time when a page may wait indefinitely:
chrome --headless --print-to-pdf --timeout=5000 https://developer.chrome.com/
For a page whose content appears only after timer-driven JavaScript, test a controlled virtual-time budget:
chrome --headless --print-to-pdf --virtual-time-budget=42000 https://mathiasbynens.be/demo/time
These tests distinguish a broken Chrome installation, sandbox or network from an application-specific defect. Keep the minimal URL, timeout and browser flags in the incident record.
Validate navigation before calling the PDF API
Playwright diagnostic script
The following Node.js example records the final URL and status, logs failed requests and non-success responses, waits for an explicit application marker, and then creates a PDF. Replace the URL and selector with values from your application.
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 matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Rank #2
- CARTRIDGE-FREE PRINTING — Print lab-quality photos, graphics and creative projects; Get vibrant colors and sharp text with Epson's high-accuracy printhead and Claria ET Premium 6-color inks
- INK BOTTLES — Save on photos1 and creative projects with affordable in-house printing; All-in-one printer allows you to print 4" x 6" photos for about 4 cents each vs. 40 cents with traditional ink cartridges1
- LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; Printer, scanner and copier lets you print up to 6,200 color pages³
- PRINT FOR LONGER — Up to 2 years of ink in the box² (and with every replacement ink set) for fewer out-of-ink frustrations with this wireless printer
- ZERO CARTRIDGE WASTE — Epson EcoTank printer helps reduce the amount of cartridge waste ending up in landfills; Cartridge-free printer uses high-yield ink bottles; Each replacement ink bottle set is equivalent to about 100 individual ink cartridges⁴
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext();
const page = await context.newPage();
const started = Date.now();
page.on('requestfailed', request => {
console.error('REQUEST FAILED', request.method(), request.url(), request.failure());
});
page.on('response', response => {
if (response.status() >= 400) {
console.error('HTTP', response.status(), response.url());
}
});
const target = 'https://example.com/invoice/123';
let response;
try {
response = await page.goto(target, {
waitUntil: 'domcontentloaded',
timeout: 30000
});
} catch (error) {
console.error('NAVIGATION FAILED', error.message);
await browser.close();
process.exit(1);
}
console.log(JSON.stringify({
originalUrl: target,
finalUrl: page.url(),
status: response ? response.status() : null,
elapsedMs: Date.now() - started
}));
if (!response) throw new Error('No main-resource response');
if (response.status() >= 400) {
throw new Error(`Main resource returned HTTP ${response.status()}`);
}
// Use a marker that proves the PDF data is present, not merely that the DOM exists.
await page.locator('[data-pdf-ready="true"]').waitFor({ state: 'visible', timeout: 15000 });
await page.emulateMedia({ media: 'print' });
await page.pdf({
path: 'invoice.pdf',
format: 'A4',
printBackground: true,
preferCSSPageSize: true,
margin: { top: '16mm', right: '12mm', bottom: '16mm', left: '12mm' }
});
await browser.close();
})();
A goto timeout or thrown error means navigation did not complete under the chosen policy. A returned 404 or 500 should be investigated as an application response; it is not evidence that Playwright itself failed. Check the final URL because redirects can send a job to a login page or an unexpected host.
Classify the common navigation failures
- SSL or certificate error: repair the certificate chain or trust configuration in the rendering environment. Do not disable verification as a permanent fix.
- Invalid URL: include a scheme such as
https://, escape characters correctly, and reject malformed input before launching a browser. - Timeout or unreachable host: check DNS, proxy and firewall rules, service health, and whether the timeout is long enough for the page’s documented worst case.
- Main-resource failure: inspect the browser error, server logs and redirect target. A response object is not guaranteed when the main request cannot be made.
- Authentication redirect: copy the required cookies, headers or credentials into the browser context and verify that the final URL is the intended page.
Find resources that failed after HTML loaded
A successful document response does not prove that the PDF inputs arrived. Keep the requestfailed and response logging from the example enabled while diagnosing. Pay particular attention to:
- Web fonts, which can cause fallback text, reflow or missing glyphs.
- Images and SVGs, especially lazy-loaded assets that are not requested until they enter the viewport.
- Stylesheets and JavaScript bundles blocked by a firewall, content-security policy or certificate mismatch.
- API calls that need authentication, a specific origin, CORS permission or a production-only DNS route.
- Iframes containing charts, payment details or other required sections.
Compare local and production DNS, outbound egress rules, proxy settings and environment certificates. If the page uses lazy loading, scroll the relevant region or expose an application signal after all required assets have been loaded. Do not treat a visually complete browser tab as proof that every request succeeded; the interactive browser may retry or load resources after the PDF job has already started.
Wait for application readiness, not just network activity
domcontentloaded means the initial HTML was parsed; load means load-event resources completed. Neither necessarily means a React table, chart or invoice total has been rendered. Define readiness as a concrete assertion that proves the content needed in the PDF exists.
Rank #3
- SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
- INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
- KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
- PREMIUM SUPPORT - Strong technical expertise to solve issues faster
- THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.
Useful readiness signals
- A visible heading containing the document identifier.
- A table with at least one data row and a known total.
- A chart container with a completed-render attribute.
- An application-set marker such as
data-pdf-ready="true". - A server-rendered status that changes from “Loading” to “Complete”.
Use a finite timeout and report which condition failed. Playwright documents networkidle, but discourages using it as a generic readiness or testing signal because analytics, websockets and polling can keep a page active—or stop before the application has finished rendering. A selector or assertion tied to the required content is more deterministic.
Make print output match the intended design
Playwright’s page.pdf() generates PDF output with print CSS media by default. A successful render can therefore differ substantially from the screen view.
Control media and paper geometry
await page.emulateMedia({ media: 'screen' }); // use only when screen styling is intended
await page.pdf({
path: 'report.pdf',
width: '210mm',
height: '297mm',
margin: { top: '10mm', right: '10mm', bottom: '12mm', left: '10mm' },
printBackground: true,
pageRanges: '1-3',
preferCSSPageSize: true
});
- Use
formatsuch asA4or explicit width and height, not an accidental default. - Set margins deliberately; excessive margins can push content onto unexpected pages.
- Enable
printBackgroundwhen colored panels or backgrounds are part of the document. - Use
pageRangesonly after confirming pagination; an invalid range can omit the content you expected. - Set
preferCSSPageSizewhen the document defines@pagedimensions that should take precedence. - Use
emulateMedia('screen')only when screen CSS is the requirement; otherwise fix the print stylesheet.
Typical blank or clipped results
- Blank PDF: the job printed before client-side content appeared, a print stylesheet hides the main container, or the selected page range excludes the content.
- Unstyled PDF: CSS failed to load, print media rules intentionally remove styling, or the stylesheet URL is inaccessible from the renderer.
- Missing fonts: the font request failed, the font is cross-origin blocked, or capture began before the font was available.
- Missing images: lazy loading, authentication, blocked requests or an image decode failure prevented the asset from being present at print time.
- Different pagination: print media, paper dimensions, margins and CSS page-break rules differ from the viewport rendering.
Operational reliability and cost controls
Use a bounded navigation timeout and a separate readiness timeout so a hung server cannot consume a worker indefinitely. Record browser and OS versions, because rendering changes can come from upgrades rather than application code. Reuse a browser process for a controlled batch, but create isolated contexts for different cookies, headers and users. Limit concurrency to what the host’s CPU, memory and outbound bandwidth can sustain; a queue with cancellation is safer than launching unlimited browsers.
Retry only transient failures such as connection resets or temporary upstream errors. Do not blindly retry deterministic 404s, certificate failures or a readiness assertion that can never become true. Store the original error, failed-request list and a screenshot or HTML snapshot when policy permits, so a later retry does not erase the evidence. For sensitive documents, avoid logging authorization headers or personal data.
Rank #4
- Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
- No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
- Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
- Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
- The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art
Or skip the browser setup
ScreenshotNeo provides a hosted capture API and MCP server. Its PDF-capable capture handles browser startup and exposes options for full-page capture, waiting for a selector, delay or network idle, custom headers and cookies, JavaScript, viewport and device settings, page ranges, paper size, margins and landscape output. Before capture it accepts cookie or consent banners 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 the response identifies the result with X-Page-Verdict and X-Billed headers. An MCP server provides take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients.
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 complete parameter reference in the ScreenshotNeo documentation. The service has 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account to try a capture.
Troubleshooting checklist
- Run the Chrome minimal reproduction.
- Log the original URL, final URL, status and elapsed time.
- Separate thrown navigation errors from returned HTTP 4xx/5xx responses.
- Log failed requests and non-success responses for fonts, images, CSS, scripts, APIs and frames.
- Verify authentication, DNS, proxy, firewall, CORS, CSP and certificate trust in the renderer.
- Wait for a selector or assertion proving the required PDF content exists.
- Set media, paper size, margins, backgrounds, page ranges and CSS page-size preference explicitly.
- Retry only failures that are plausibly transient, and retain diagnostics for every attempt.
FAQ
Does a 500 response always stop Playwright?
No. An HTTP 500 can be returned as the main-resource response. Your code must inspect the status and decide whether that response is acceptable.
Should I always wait for networkidle?
No. Use it only when it represents your application’s behavior. A content assertion is usually a clearer readiness contract.
Why does the PDF differ from the browser screenshot?
PDF generation uses print media by default and applies paper, margin, background and page-break rules. Emulate screen media only when screen styling is the intended output.
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.

