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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

In Puppeteer, set the PDF-generation limit with the timeout property passed to page.pdf(). The value is milliseconds. In the documented Puppeteer 25.12.0 API, the default is 30,000 ms (30 seconds), and 0 disables this particular timeout.

That setting controls PDF rendering only. Navigation, HTML injection, font loading, and any waits you perform have separate timing behavior, so identify the operation that actually times out before changing a limit.

Set the page.pdf() timeout

Here is a complete Node.js example. It gives page navigation 30 seconds, then allows up to 60 seconds for PDF generation:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    headless: true,
  });

  try {
    const page = await browser.newPage();

    // This controls navigation, not PDF rendering.
    await page.goto('https://example.com', {
      waitUntil: 'networkidle2',
      timeout: 30_000,
    });

    await page.pdf({
      path: 'output.pdf',
      format: 'A4',
      printBackground: true,
      timeout: 60_000,
    });
  } finally {
    await browser.close();
  }
})();

The PDFOptions reference documents timeout in milliseconds. For Puppeteer 25.12.0, its documented default is 30,000 ms; passing 0 disables the PDF call’s timeout. The API reference is the authoritative place to check the default for the version installed in your project: Puppeteer PDFOptions.

#1 Best Overall
Sale
Liene M100 4x6'' Photo Printer, Phone Printer 100 Sheets & 3 Cartridges, Full-Color Photo, Portable Instant Photo Printer for iPhone Android, Thermal Dye Sublimation, Wi-Fi Picture Printer 100 Papers
  • User-Friendly Portable Photo Printer for iPhone, Android & PC - Get beautiful and colourful memories with Liene 4x6 photo printer! After opening the entire package, you can find one cartridge + 20 sheets of photo paper (placed inside the machine packaging), as well as an additional box containing 80 sheets of photo paper (which includes two cartridges + 80 sheets of photo paper). Full package includes smartphone photo printer, Liene 4x6 photo printer papers (100 sheets), 3 colour cartridges, and fully sealed cassette to prevent dust. Minimalist and magnetic design for compact storage.
  • Superior Quality 4x6 Photo Printer - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Clean the print head promptly if smudges are observed on printed photos during operation. Get Liene photo printers now for yourself and your loved ones, print your happy moments together and keep your love forever!
  • Wi-Fi Photo Printer for Smartphone - The built-in hotspot of the photo printer makes it easy to print pictures from your phone, avoiding outside interference with a fast and stable connection. No other networks required! Simply connect your device to the independent instant photo printer 4x6 hotspot.
  • Multiple Device Compatibility - Liene phone printer provides instant photo printing for up to 5 simultaneous connections. Share with family and friends or print from your different devices. No additional cables or Bluetooth required when printing photos with this picture printer. Note: Ensure the ink cartridge clicks into place before printing.
  • Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Square border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this photo printer for iphone 4x6 prints.

Choose a deadline that matches the workload

There is no universal value recommended by Puppeteer. A simple, already-loaded page may finish quickly, while a long document with many images, complex print CSS, or slow fonts needs more time. Set a limit that fits your document and your outer request deadline. For example, if an HTTP endpoint must respond within 90 seconds, a 60-second PDF timeout leaves time to handle the error and return a response rather than letting the process run until the client disconnects.

Use 0 only when an unlimited wait is genuinely acceptable. An unlimited render can consume a worker indefinitely when a page, font, or resource never completes.

Understand the separate timeout layers

A “PDF timeout” message can originate from several awaited operations. Puppeteer does not use one global switch for all of them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
KODAK Dock Plus 4x6 Photo Printer, Smartphone Docking, 4PASS, 50 Sheets
  • Dock Photo Printer: The KODAK Dock Plus is a home photo printer that produces high-quality 4x6” prints directly from compatible smartphones. Featuring an integrated docking station, users can place their phone on the printer for better connection while simultaneously charging the device during printing.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Dock Plus is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Home Printing Station: Designed for stable desktop use, this dock photo printer connects to a power outlet for consistent performance and larger 4x6” prints. Ideal for home printing, photo albums, framing, family events, and everyday picture printing.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.
Stage Typical operation Controlling setting Unit/default
Navigation page.goto(), reload() The method’s timeout, or page.setDefaultNavigationTimeout() Milliseconds; method/API default applies
HTML preparation page.setContent() The method’s navigation timeout behavior or page.setDefaultNavigationTimeout() Milliseconds
Explicit waits waitForSelector(), waitForFunction(), and similar calls The wait’s timeout, or a page default timeout Milliseconds; wait API default applies
PDF rendering page.pdf() PDFOptions.timeout Milliseconds; 30,000 ms documented in Puppeteer 25.12.0; 0 disables

Page.setDefaultNavigationTimeout() governs navigation-related methods, including goto, reload, and setContent; it does not replace the timeout supplied to page.pdf(). Conversely, increasing a navigation timeout will not make a PDF render wait longer.

Set navigation and PDF limits independently

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    page.setDefaultNavigationTimeout(45_000);

    await page.goto('https://example.com/report', {
      waitUntil: 'domcontentloaded',
    });

    await page.pdf({
      path: 'report.pdf',
      timeout: 90_000,
    });
  } finally {
    await browser.close();
  }
})();

Passing a timeout directly to the operation that can fail makes diagnosis easier than changing a broad default. If goto() throws, adjust navigation or page readiness. If pdf() throws after the page is ready, adjust the PDF option or reduce rendering work.

Page readiness, fonts, and print output

PDF rendering starts only after your preceding setup has completed, but it can still spend significant time preparing the print output. Puppeteer’s PDF guide states that Page.pdf() waits for fonts by default. The waitForFonts PDF option is enabled by default, and the documentation notes that font readiness may require bringing a background page to the foreground. Slow, blocked, or unavailable font files can therefore account for a long wait.

Rank #3
Sale
Nelko PP01 Photo Printer, 2x3 Portable Photo Printer, Mini Printer, White
  • 2x3" Portable Photo Printer: The upgraded PP01 photo printer uses advanced inkjet technology. This portable photo printer produces vivid, full-color prints on premium sticky-backed photo paper that is smudge-proof, water-resistant, and tear-resistant. The Nelko mini photo printer is pocket-sized and weighs only 308g, making it ultra-portable for school, travel, and field trips. Each ink cartridge prints up to 80 full-color 2x3 photos on sticky-backed paper
  • Easy Printing via Bluetooth: The PP01 mini photo printer is compatible with iOS and Android phones via Bluetooth. Simply download the Nelko app from Google Play or the App Store. Load the 2x3 photo paper with the smooth side facing down. Install the ink cartridge, connect via Bluetooth, and print directly using the Nelko app. A USB charging cable is included; the adapter is not included
  • High Photo Quality: This mini photo printer uses advanced inkjet technology for clear, vibrant prints. This portable photo printer produces 600 DPI high-resolution images with precise colors, capturing fine details and realistic tones. Each photo comes with adhesive backing, perfect for scrapbooks and preserving your memories. Personalize every photo for holidays, birthdays, or daily events
  • Powerful App: The Nelko 2x3" PP01 photo printer app lets you edit photos and offers a variety of frame designs, making it perfect for personalizing your photos for projects like scrapbooking or journaling. Download the Nelko app to create collages and customize photos with filters, graffiti, borders, stickers, text, AI image editing, and many other features. Edit photos on your phone, then send them to the Nelko app for instant printing in under 90 seconds
  • Versatile Usage Scenarios: This portable photo printer is ideal for travel journals, party favors, and family gatherings. Students use it for planners and photo printing. Crafters use it for DIY projects, custom labels, and scrapbooking. It's a practical tool for bloggers, small businesses, and event photographers to create instant giveaways. Perfect for Mother's Day surprises and heartfelt moments with loved ones using Nelko sticky-backed photo paper.

Wait for application data explicitly

Do not use a large PDF timeout as a substitute for waiting for your own application state. Wait for a selector or readiness flag, then render:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.goto('https://example.com/invoice/123', {
  waitUntil: 'domcontentloaded',
  timeout: 30_000,
});

await page.waitForSelector('[data-report-ready="true"]', {
  timeout: 20_000,
});

await page.pdf({
  path: 'invoice.pdf',
  format: 'A4',
  printBackground: true,
  timeout: 60_000,
});

This separates “the page never became ready” from “Chromium could not finish printing.”

Use the intended media type

page.pdf() uses print CSS by default. If the document must match screen styles, call page.emulateMediaType('screen') before generating the file:

Rank #4
Liene Amber M110 Bluetooth Photo Printer 80 Sheets, Portable Photo Printer for iPhone, Thermal Dye Sublimation, Picture Printer 60 Sheets 4x6 Paper & 20 Sheets 3" Square Sticker Paper & 2 Cartridges
  • Dual 4x6" & 3x3" Photo Printer Paper Tray Convenience: Seamlessly print both 6-inch standard photo paper and 3-inch sticky-backed paper with our innovative dual tray design. This compact phone photo printer for smartphone offers easy storage and quick access, making it perfect for diverse printing needs without taking up much space. Enjoy vibrant, high-quality prints every time.
  • Fast Bluetooth Connectivity: Experience lightning-fast printing with our liene photo printer's Bluetooth connection, which pairs in just 13 seconds. Enjoy a seamless and efficient printing experience, perfect for capturing and sharing memories on the go without the hassle of cables or complex setups.
  • Superior Quality Photo Printer 4x6 - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Get Liene photo printers now as amazing gifts for yourself and your loved ones, print your happy moments together and keep your love forever!
  • Multiple Device Compatibility - Liene picture printer for iphone provides instant photo printing for up to mutiple simultaneous connections. Share with family and friends or print from your different devices. No additional cables required when printing photos with this phone printer.
  • Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Polaroid border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this iphone photo printer for 4x6 & 3x3 prints.
await page.emulateMediaType('screen');
await page.pdf({
  path: 'screen-styled.pdf',
  timeout: 60_000,
});

Changing media type can alter pagination, background images, and the amount of layout work; it does not change which option controls the PDF timeout. See the Page.pdf() API and PDF generation guide.

Handling errors and outer request deadlines

Wrap generation in try/catch and always close the browser or page in finally. A timeout is an operational failure, not a reason to leave a Chromium process running:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const puppeteer = require('puppeteer');

async function createPdf(url, file) {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    await page.goto(url, { waitUntil: 'networkidle2', timeout: 30_000 });
    await page.pdf({ path: file, timeout: 60_000, format: 'A4' });
    return file;
  } catch (error) {
    if (error instanceof Error && /timeout/i.test(error.message)) {
      throw new Error(`PDF job timed out: ${error.message}`);
    }
    throw error;
  } finally {
    await browser.close();
  }
}

createPdf('https://example.com', 'output.pdf')
  .then(console.log)
  .catch(console.error);

For a web service, enforce an outer deadline as well (for example, your job-queue or HTTP request limit). The inner Puppeteer timeout should expire before that outer deadline so you can clean up and return a useful error. The page.pdf() reference documents a numeric timeout; it does not document an AbortSignal parameter. Puppeteer’s documented signal support applies to supported wait operations, so do not pass an abort signal to page.pdf() expecting direct cancellation. See WaitTimeoutOptions.

Best Value
KODAK Mini 2 Retro 2x3 Portable Photo Printer, 4PASS, 38 Sheets, White
  • Instant Photo Printing: The KODAK Mini 2 Retro is a portable photo printer designed to turn smartphone pictures into high quality prints in seconds. Whether capturing family moments, travel highlights, journaling pages, or creative projects, this mini printer lets you print real photos anytime, anywhere.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Mini 2 Retro is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Print Anytime, Anywhere: Small enough to fit in your hand, bag, or even a pocket, the Mini 2 Retro is built for on-the-go printing. Ideal for parties, trips, school projects, scrapbooks, and spontaneous moments where you want real prints without waiting.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot a PDF timeout

The error names goto or navigation

  • Cause: The URL, redirects, DNS, server response, or chosen waitUntil condition did not complete within the navigation limit.
  • Fix: Increase the goto() timeout or setDefaultNavigationTimeout() only after confirming the page is expected to be slow. Try a less demanding readiness condition such as domcontentloaded, or wait for a specific application selector after navigation.

The error occurs at page.setContent()

  • Cause: Content preparation is governed by navigation-related timing, not the PDF option.
  • Fix: Set the timeout on setContent() where supported and inspect external images, stylesheets, and fonts referenced by the HTML. Keep the separate page.pdf({ timeout }) for rendering.

The error occurs at page.pdf()

  • Cause: Chromium has not completed layout and print rendering within PDFOptions.timeout.
  • Fix: Raise that value within the job’s outer deadline, reduce page complexity, remove unnecessary resources, or wait for application readiness before calling PDF. Check font requests in the page and browser logs.

The page looks incomplete even though no timeout occurred

  • Cause: The PDF call began before client-side data or images were ready, or print CSS hides content.
  • Fix: Wait for a reliable selector or readiness flag, verify image loading, inspect print styles, and choose screen media when that is the intended output.

Setting setDefaultTimeout() changed nothing

  • Cause: That default primarily affects generic waits; it is not a replacement for the PDF option and does not control navigation in the same way.
  • Fix: Set the option on the failing call: navigation timeout for goto/setContent, wait timeout for a wait operation, and PDFOptions.timeout for page.pdf().

Performance and reliability practices

  • Measure each phase: Record timestamps before navigation, readiness waits, and PDF generation so the limit is based on the slow phase rather than guesswork.
  • Keep documents bounded: Very long pages, large raster images, and complex CSS increase layout and memory pressure. Split oversized reports when your product permits it.
  • Make resources deterministic: Self-host or reliably serve fonts and images needed for the document; a font request that never resolves can consume the PDF deadline.
  • Reuse carefully: A browser process can serve multiple jobs, but create isolated pages and close them after each job. Always close the browser on fatal errors.
  • Retry selectively: A retry can help with a transient upstream response, but repeating an indefinitely blocked page only adds load. Log the failing stage and error before retrying.
  • Align all deadlines: Queue visibility, worker execution, HTTP reverse-proxy, and client timeouts should exceed the PDF timeout by enough time for cleanup and an error response.

Or skip the browser setup

If your goal is a PDF or screenshot of a URL rather than controlling Chromium yourself, ScreenshotNeo provides a website screenshot API and MCP server. Its PDF endpoint can handle the browser work in one request. Cookie and consent banners, newsletter popups, and chat widgets are removed before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. AI agents can use its MCP tools take_screenshot, get_page_info, and capture_pdf.

Use the documented API options for paper size, margins, landscape mode, and page ranges. The API also supports custom CSS and JavaScript, headers, cookies, user agents, authorization, waiting for a selector or network idle, and bulk capture when your workflow needs more than a single URL. Every plan includes the features. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

cURL

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

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://example.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://example.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`ScreenshotNeo returned ${res.status}`);
const body = Buffer.from(await res.arrayBuffer());
require('fs').writeFileSync('shot.webp', body);

See the ScreenshotNeo documentation for PDF parameters and response headers. Create a free account to get 1,000 screenshots each month with no card.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

What to remember

  1. Put timeout in the options passed to page.pdf(); use milliseconds.
  2. In Puppeteer 25.12.0, the documented default is 30 seconds and 0 disables the PDF timeout.
  3. Navigation, content setup, explicit waits, and PDF rendering have different controls.
  4. Fonts are awaited by default, so font delivery can affect the observed render time.
  5. Set an outer job deadline and clean up the browser when a render fails.

Frequently Asked Questions

Does Puppeteer’s PDF timeout include the time spent in page.goto()?

No. The timeout passed to page.pdf() applies to the PDF call. Configure navigation separately with goto() or setDefaultNavigationTimeout().

Can I cancel page.pdf() with an AbortController?

The PDFOptions reference documents a numeric timeout, not an AbortSignal parameter. AbortSignal support documented for wait operations should not be assumed to cancel page.pdf() directly.

What happens when PDFOptions.timeout is set to 0?

Puppeteer treats 0 as disabling the PDF operation’s timeout. Your process can still be constrained by an outer HTTP, queue, worker, or infrastructure deadline.

Why can a PDF wait even after the page appears loaded?

Page.pdf() waits for fonts by default, and print layout still has to complete. Slow font requests or complex print content can account for the additional time.

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

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.