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

If Puppeteer appears to hang while making a large PDF, first find out whether it is still waiting for the page or stuck inside page.pdf(). Then reduce the document, check font and print-media behavior, record the exact Puppeteer and browser versions, and investigate the runtime. Increasing the PDF timeout can give a slow job more time, but it does not identify or fix the underlying cause.

Find out which step is hanging

A PDF job includes more than PDF generation: navigation, application rendering, image loading, font readiness and other waits may all happen before page.pdf() runs. A script that looks stuck may never have reached the PDF call. Mark each phase so you can tell where time is going before changing settings.

  1. Record entry into navigation. Log immediately before and after page.goto() or any content-loading step.
  2. Record readiness waits separately. Log before and after waits for a selector, images, application data or fonts. Do not combine these with navigation or PDF generation in one opaque wait.
  3. Mark the PDF call. Log immediately before and after page.pdf(). If the “before PDF” message never appears, investigate an earlier wait. If it appears but the “after PDF” message does not, focus on a minimal reproduction of PDF generation.
  4. Capture the error and elapsed time. Keep the original exception and note whether the operation exceeded its configured timeout, rather than treating every delay as the same kind of failure.

This division matters: changing a PDF option cannot fix a navigation wait that never completes, and changing navigation settings will not necessarily help a call that has already entered PDF generation.

Reduce the document before changing the browser

Try generating a smaller version of the same document. Remove or reduce pages, images and other heavy assets while keeping the relevant CSS and content structure as close to the failing case as possible. If the smaller version succeeds, add the content back in stages. That can reveal whether the failure is associated with document size or a particular asset, without assuming a universal page or image limit.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

An unconfirmed Puppeteer issue from 2017 described hangs with many images and an out-of-heap error after the reporter removed a Node heap flag. That is a reason to observe memory and test an image-heavy reproduction; it is not a supported image-count threshold or proof that heap size explains your case. The reported counts and settings belong to that individual’s reproduction, not a general capacity limit.

Keep a minimal failing input: the URL or HTML, the PDF options, the timestamps, and the versions and runtime details listed below. A small reproduction is easier to compare across environments than a production page with many unrelated moving parts.

Check PDF options and rendering behavior

Puppeteer’s PDF method is Page.pdf(). Its documented defaults include a 30,000 ms timeout and waitForFonts: true. PDF printing uses the print media type by default. Review these behaviors deliberately rather than changing several options at once.

Timeout: allow time, but do not mistake it for a fix

The PDF option timeout controls how long the PDF operation waits; the documented default is 30,000 ms. A longer timeout may be appropriate if the job is known to take longer and completes when given more time. It will not explain whether the delay comes from content, fonts, browser behavior or the runtime. A value of 0 disables the API timeout; use that only for a job you can monitor and stop through another mechanism, since it removes this particular bound rather than making the job reliable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Fonts: determine whether waiting is necessary

waitForFonts is true by default. If the document uses web fonts, establish whether they finish loading before PDF generation. Disabling the wait may change the timing, but it can also produce output before the expected fonts are ready. Treat it as a diagnostic comparison, not an automatic performance fix: compare the resulting PDF and verify that the intended typography is present.

Print versus screen media

PDF generation uses print media by default, so print-specific CSS may change layout, hide content or alter page length compared with a browser screenshot. If your page is intentionally designed for screen media, explicitly emulate screen media before calling page.pdf(), then compare the output. Do this only when screen styling is the desired result; print media is the normal PDF behavior.

Page ranges and sizing

Review the page size, margins and page ranges you request. A page range can help isolate whether a particular section is associated with the delay, while a smaller document gives you a controlled comparison. Keep the other settings constant when testing so that a successful run tells you which change mattered.

A runnable Node.js diagnostic example

This example accepts a URL and output filename, records the navigation and PDF phases, and makes the PDF timeout and font behavior explicit. Install Puppeteer in the project using the package-management method appropriate for your environment, save the script as pdf-diagnose.js, and run node pdf-diagnose.js https://example.com output.pdf. Use a page you are authorized to access.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
const puppeteer = require('puppeteer');

const url = process.argv[2];
const output = process.argv[3] || 'output.pdf';

if (!url) {
  console.error('Usage: node pdf-diagnose.js <url> [output.pdf]');
  process.exit(1);
}

function mark(message) {
  console.log(new Date().toISOString(), message);
}

(async () => {
  let browser;
  try {
    mark('Launching browser');
    browser = await puppeteer.launch();
    const page = await browser.newPage();

    mark('Starting navigation');
    const response = await page.goto(url, { waitUntil: 'domcontentloaded' });
    mark(`Navigation completed; HTTP status: ${response ? response.status() : 'no response'}`);

    // Add application-specific readiness waits here, with their own log markers.
    mark('Starting page.pdf()');
    await page.pdf({
      path: output,
      format: 'A4',
      timeout: 30000,
      waitForFonts: true
    });
    mark(`PDF saved to ${output}`);
  } catch (error) {
    mark('Job failed');
    console.error(error);
    process.exitCode = 1;
  } finally {
    if (browser) {
      await browser.close();
      mark('Browser closed');
    }
  }
})();

The example uses domcontentloaded to make the navigation boundary visible; it does not claim that the page’s own content is ready at that point. Add a separate, page-specific readiness check if the application renders content after initial HTML arrives. If that wait stalls, the timestamps distinguish it from a PDF call that actually began.

Or skip the browser setup

If you need a rendered capture or PDF without managing a local Puppeteer browser, ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. Its clean-shot process accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each cleanup step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and responses report the page verdict and billing status in headers. An MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.

For a one-request PDF, use the documented PDF options as needed; this basic request demonstrates the API call and saves the response. See the ScreenshotNeo API documentation for request parameters and PDF settings.

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

ScreenshotNeo is a separate capture service, not a change to your Puppeteer installation or a diagnosis of a Puppeteer failure. It may suit a workflow where the required result is a hosted screenshot or PDF rather than a locally controlled browser session. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots.

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

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check versions and the execution environment

Record the Puppeteer package version and the actual browser executable and version it launched; do not assume the browser version from a separate desktop installation. Also record the operating system or container image, memory constraints, launch configuration, browser permissions and relevant deployment/runtime details. These facts make it possible to compare a working and failing run rather than changing versions blindly.

A Windows report from 2024 described a timeout in a small-content case with Puppeteer 22.9.0 and Chrome for Testing 125.0.6422.60; the reporter said Chrome 121 succeeded. The report was closed as not planned and marked needs-feedback/not-reproducible. It is a reason to capture browser and platform versions when investigating, not evidence of a general Chrome 125 defect or a reason for every user to downgrade.

Puppeteer’s troubleshooting guidance also points to platform and deployment conditions, including sandbox setup, dependencies, browser permissions and cloud runtime behavior. Compare the same minimal case in the intended runtime and, where practical, another supported environment. A difference narrows the investigation; it does not by itself prove which environmental factor caused it.

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

Keep sandboxing a security decision

Do not add --no-sandbox as a casual timeout or performance fix. Puppeteer’s troubleshooting guidance strongly discourages running Chrome without a sandbox. If a deployment has a sandbox setup problem, address it in the context of that runtime’s security requirements rather than removing the protection to make a PDF test pass.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Troubleshoot by symptom

What you observe What to check next How to interpret the result
The script never logs that page.pdf() is starting. Separate navigation from each application-readiness wait; log entry and completion around each one. The stall is before PDF generation. Diagnose the wait that did not complete instead of changing PDF options first.
The PDF call starts and exceeds 30 seconds. Compare a reduced document, check font readiness and media behavior, and review the configured timeout. A longer timeout can test whether a slow job eventually completes; success after increasing it does not establish why the job was slow.
A reduced document completes but the full one does not. Add images, pages or other heavy content back in stages and observe memory and elapsed time. The workload is relevant to the difference. Do not infer a universal image or page threshold from one run.
The PDF finishes but layout or fonts differ from the expected page. Check whether print media is intended, whether required fonts have loaded, and whether page size, margins and ranges match the desired output. This is a rendering or readiness mismatch, not necessarily a hang in the browser.
The same input behaves differently across machines or deployments. Compare Puppeteer and browser versions, OS/container, memory limits, permissions, dependencies, launch settings and sandbox configuration. Use the differences to narrow the reproduction. A historical version-specific report does not prove the cause in your environment.
The job never times out after setting timeout to zero. Restore a finite timeout or add an independent job-level deadline and monitoring. Zero disables the PDF API timeout; it does not make the operation complete or provide a diagnosis.

Performance, reliability and cost considerations

Optimize the measured slow phase, not the phrase “large PDF.” If navigation or application readiness consumes the time, focus on that phase. If the delay is inside page.pdf(), use a reduced reproduction and controlled comparisons for assets, fonts, media and PDF options. Preserve the original output requirements during tests: changing media type or skipping font readiness can make a run finish while also changing the document.

For reliability, log the input URL or job identifier, phase timestamps, exception, options and browser/runtime versions. A timeout gives a bounded wait; disabling it removes that bound and calls for an independent way to observe and stop long-running jobs. Keep browser cleanup in a finally path, as in the example, so failures do not leave that script’s browser open.

The available documentation establishes API behavior and troubleshooting areas, not a universal performance recipe. The 2017 image-heavy report is unconfirmed, and the 2024 Windows/browser report was not reproducible. Neither establishes a reliable image-count cutoff, a general version downgrade fix, or a requirement to add RAM or buy different hardware.

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

What to include in a useful bug report

  • A minimal page or reproduction and the exact command or script that runs it.
  • Separate timestamps for navigation, readiness waits and entry/exit of page.pdf().
  • The full error or timeout, PDF options, and whether a reduced version completes.
  • Puppeteer version, actual browser version, OS or container image, runtime constraints and launch configuration.
  • Whether fonts are expected, whether print or screen media is intended, and whether the result changes in another environment.

These details let another developer distinguish a pre-PDF wait from a PDF-generation failure and compare the same conditions. Avoid presenting an individual issue report as proof of a universal browser defect.

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.