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

Use page.pdf() with a custom width and height, or let a CSS @page rule own the dimensions with preferCSSPageSize: true. Puppeteer prints with the print CSS media type by default. Set the height to the content you intend to keep on one sheet, inspect the resulting PDF for clipping or unexpected page breaks, and test the exact Chrome/Puppeteer runtime you deploy: the Puppeteer 25.12.0 reference does not publish a maximum supported custom height.

The shortest working example

This script creates a single custom-sized page. The height value is deliberately an example; replace it with a dimension appropriate for your document. A standard Letter or A4 format is not suitable when the entire document must occupy one unusually tall page.

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com', { waitUntil: 'networkidle0' });

    await page.pdf({
      path: 'long.pdf',
      width: '8.5in',
      height: '120in',
      margin: 0,
      printBackground: true
    });
  } finally {
    await browser.close();
  }
})();

Page.pdf() generates a PDF using print CSS. In this example, the PDF has an 8.5-inch width, a 120-inch height, and no margins. Choose a height that contains the rendered content, then open the file in a PDF viewer and confirm it has exactly one page and no clipped elements.

Choose one source of truth for the page size

Puppeteer gives you two valid ways to specify the sheet. Do not combine them casually: conflicting settings make it difficult to know which dimension the browser used.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Brother DCP-L2640DW Wireless Compact Monochrome Multi-Function Printer, Copy, Scan, Duplex, Mobile Printing
  • BEST FOR SMALL BUSINESSES – Engineered for extraordinary productivity, the Brother DCP-L2640DW Monochrome (Black & White) 3-in-1 combines laser printer, scanner, copier in one compact footprint and delivers high-quality black & white prints
  • FAST PRINTER WITH EFFICIENT SCANNING – Produces documents quickly with print speeds up to 36 ppm(2) and scan speeds up to 23.6/7.9 ipm(3) (black/color). A 50-page auto document feeder(4) allows for convenient, time saving multi-page scanning and copying
  • FLEXIBLE CONNECTION OPTIONS – Easily navigate the changing demands of your business with secure multi-device connectivity via built-in dual-band wireless (2.4GHz / 5GHz) and Ethernet. Or connect locally to a single computer via USB interface
  • BROTHER MOBILE CONNECT APP – Print, scan, and manage your wireless printer anytime, from almost anywhere from your mobile device. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(5)
  • CHOOSE BROTHER GENUINE TONER – When it’s time to replace your toner, be sure to choose Brother Genuine TN830 or TN830XL replacement toner. And with Refresh EZ Print Subscription Service, you’ll never worry about running out of toner again and you’ll enjoy savings of up to 50%(6) on Brother Genuine Toner. Get started with Refresh today with a Free Trial(1)
Method Configuration When it fits Important behavior
API dimensions width and height in PDFOptions Your application calculates or configures the size in JavaScript Use custom dimensions for a long page; leave out format
CSS dimensions @page { size: …; } plus preferCSSPageSize: true The document stylesheet should control print geometry CSS page size takes priority when this option is enabled
Standard format format: 'A4', 'Letter', or another paper format Conventional fixed sheets format takes priority over width and height; it is generally the wrong choice for one very tall page

API-controlled dimensions

Keep the dimensions in the PDF call when the server, a template, or a job record determines the desired height:

await page.pdf({
  path: 'long.pdf',
  width: '8.5in',
  height: '120in',
  margin: { top: 0, right: 0, bottom: 0, left: 0 },
  printBackground: true,
  scale: 1,
  timeout: 60000
});

The documented scale range is 0.1 through 2. Scaling changes the rendered result, so leave it at 1 unless you intentionally need a smaller or larger rendering. The default PDF timeout is 30 seconds; increase it only when the page genuinely needs more time and you have also made its resources ready.

CSS-controlled dimensions

Put the dimensions in the page stylesheet and opt in to CSS page sizing:

<style>
  @page {
    size: 8.5in 120in;
    margin: 0;
  }

  html, body {
    margin: 0;
  }
</style>
await page.pdf({
  path: 'long.pdf',
  preferCSSPageSize: true,
  printBackground: true
});

preferCSSPageSize defaults to false. With the default, content is scaled to fit the paper size selected by the PDF options. Enabling it makes the CSS @page size win, which is useful when the same print stylesheet is used by browsers and by Puppeteer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Brother HL-L2405W Wireless Compact Monochrome Laser Printer with Mobile Printing, Black & White Output | Includes Refresh Subscription Trial(1), Works with Alexa
  • BEST FOR HOMES & HOME OFFICES – Engineered for consistent, premium print quality, the Brother HL-L2405W Monochrome (Black & White) Laser Printer delivers sharp, crisp prints at an affordable price. Prints one-sided documents at speeds up to 30ppm(2)
  • COMPACT, CONNECTED PRINTER – Flexible connection options make this an ideal printer for home use and at-home offices. Securely connect to multiple devices with built-in dual-band wireless (2.4GHz/5GHz) or locally to a single computer via USB interface
  • BROTHER MOBILE CONNECT APP – Manage your printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
  • VERSATILE PAPER HANDLING – Enjoy seamless, reliable everyday printing with the 250-sheet paper tray(4) and a manual feed slot that enables printing on envelopes and specialty pape
  • BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer

Control print and screen appearance

Puppeteer uses the print media type for PDF generation. Rules inside @media print therefore apply, while screen-only rules may not. If the design was written specifically for the screen, switch media before generating the PDF:

await page.emulateMediaType('screen');
await page.pdf({
  path: 'long-screen-styled.pdf',
  width: '8.5in',
  height: '120in',
  margin: 0
});

Use either print or screen media intentionally. Switching to screen does not turn off pagination; it only changes which CSS media rules are active.

Backgrounds and exact colors

printBackground is false by default. Set it to true when panels, gradients, images, or colored sections are part of the intended output. Browser printing also adjusts colors by default. For color-critical designs, add this rule to the print stylesheet:

* {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

Exact color adjustment can increase ink or toner use on a physical printer. It affects color treatment, not the page dimensions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Canon imageCLASS LBP6030w - Monochrome Single-Function Wireless Compact Wireless Laser Printer, 1 Year Limited Warranty, 19 PPM, White - Print Only
  • FAST PRINT SPEEDS: Print up to 19 pages per minute.
  • COMPACT DESIGN: Space-saving, compact design fits anywhere in your home, school or small office.
  • WIRELESS CONNECTIVITY: Print from almost anywhere in your workspace using your compatible mobile device.
  • PAPER CAPACITY: Up to 150 sheets.
  • SUSTAINABILITY: Uses less than 2 watts in Energy Saver mode.

Margins, fonts, and scale

  • Margins: The PDF options default to no margins. Set an explicit margin when the document needs an inset; use zero margins for an edge-to-edge custom sheet where that is appropriate.
  • Fonts: PDF generation waits for fonts by default (waitForFonts: true). Keep that behavior unless you have a specific reason to change it, and make sure web fonts are reachable from the capture environment.
  • Scale: Keep scale at 1 for predictable dimensions. Values outside 0.1–2 are invalid.

A production-ready capture sequence

A reliable one-page job has four phases: load the document, make dynamic content settle, choose one sizing method, and validate the artifact.

  1. Launch and isolate a page. Create a fresh page for each job or otherwise reset state so cookies, viewport settings, and styles from another job cannot leak into it.
  2. Load all required content. Wait for the navigation condition your page actually needs. A network-idle condition can help for a mostly static page, but it is not a substitute for waiting on an application-specific render signal.
  3. Wait for application rendering. If a chart, image, or component appears after navigation, wait for its selector or your own readiness flag before calling page.pdf(). The PDF method’s default font wait does not guarantee that arbitrary JavaScript has finished.
  4. Generate with one size authority. Use API width/height, or CSS @page with preferCSSPageSize. Do not add a competing format.
  5. Inspect the result. Check the page count, top and bottom edges, background graphics, fonts, and any content that was positioned near the intended height. The official reference does not state a maximum custom height, so validation on the target browser build is essential.

Here is a complete JavaScript example with an explicit application-ready marker:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({ headless: true });
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com/report', {
      waitUntil: 'domcontentloaded',
      timeout: 60000
    });
    await page.waitForSelector('[data-report-ready]', { timeout: 60000 });

    await page.pdf({
      path: 'report-long.pdf',
      width: '8.5in',
      height: '120in',
      margin: 0,
      printBackground: true,
      waitForFonts: true,
      timeout: 60000
    });
  } finally {
    await browser.close();
  }
})();

Replace the readiness selector with one your application sets after data and visual components are complete. If your page can grow beyond the chosen height, either calculate a larger height before the job or redesign the output as multiple pages; do not assume Puppeteer will silently extend a custom sheet.

How to avoid clipping and accidental extra pages

Make the height intentional

A custom page is not automatically sized to the document’s content. A height that is too short can clip the bottom or force overflow into another page; a height that is much too large leaves unused space. Establish the target height from the template or from a measurement performed after the page has rendered, then verify the generated PDF rather than relying on a theoretical limit.

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.
Rank #4
Brother HL-L2460DW Wireless Compact Monochrome Laser Printer with Duplex, Mobile Printing, Black & White Output | Includes Refresh Subscription Trial(1), Works with Alexa
  • BEST FOR HOME OFFICES & SMALL TEAMS – Engineered for consistent, premium print quality, the Brother HL-L2460DW Monochrome (Black & White) Laser Printer produces documents that are clear, crisp, and easy to review and share, all at an affordable price
  • COMPACT, CONNECTED, EXCEPTIONALLY EFFICIENT– Connect with built-in dual-band wireless (2.4GHz/5GHz), Ethernet, or to a single computer via USB interface. Prints at speeds up to 36ppm(2), plus automatic duplex printing saves time and reduces paper waste
  • BROTHER MOBILE CONNECT APP – Manage your wireless printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
  • VERSATILE PAPER HANDLING – Tackle high-volume black & white printing with the 250-sheet capacity paper tray.(4) The manual feed slot enables printing on envelopes and specialty paper
  • BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer

Remove layout rules that fight print output

Fixed viewport panels, absolutely positioned elements, and overflow containers can hide content even when the PDF sheet is tall enough. Review overflow, fixed heights, sticky headers, and print-specific display rules. For a long single sheet, the document’s outer flow should be allowed to extend vertically.

Keep units and margins consistent

Use one unit system for the chosen dimensions and the @page rule. If the CSS rule says zero margins but the API supplies a margin object, the result can be surprising; select one owner and keep the other unspecified unless you have a deliberate reason to override it.

Common failures and fixes

Symptom Likely cause Fix
The PDF has several pages The height is too short, a conflicting format is active, or CSS pagination rules create breaks Remove format, increase the custom height or enable CSS sizing, and inspect print rules such as forced page breaks
The bottom of the document is missing Content exceeds the selected sheet or an ancestor has a fixed height/overflow Render first, choose a larger height, and remove or revise the constraining layout rule
Colors or background panels disappear printBackground is still false, or print color adjustment changes the appearance Set printBackground: true and use -webkit-print-color-adjust: exact when exact colors are required
Screen layout is replaced by a print layout PDF generation uses print media by default Call page.emulateMediaType('screen') before page.pdf(), or add the missing print rules
Text uses fallback fonts Fonts were not available when rendering began Ensure font URLs are reachable and retain the default font wait; also wait for your app’s ready marker
The job times out Navigation, application rendering, or PDF generation exceeds the timeout Set a justified larger timeout, reduce unnecessary resources, and wait for a deterministic readiness condition instead of an arbitrary long delay
Dimensions appear ignored format takes precedence over width and height, or CSS sizing is not enabled Use only one sizing method and set preferCSSPageSize: true when CSS should control the sheet
A very tall page fails only in production The deployed Chrome/Puppeteer build has different practical limits or resource pressure Test the exact production runtime, monitor memory and generation time, and use a multi-page design when the target cannot reliably render the required height
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance and reliability considerations

A tall page concentrates every image, font, chart, and DOM node into one render. Large pages can therefore consume more memory and take longer than ordinary fixed-size PDFs. Keep assets appropriately sized, avoid repeatedly re-rendering the same application state, and close the browser or page in a finally block so failed jobs do not leave Chromium processes behind.

Use deterministic readiness signals rather than simply sleeping for a guessed number of milliseconds. Keep the PDF timeout separate from navigation and application timeouts so logs identify which phase failed. When a job is important, retain the input URL, selected dimensions, media type, and Puppeteer/Chrome versions with the artifact metadata; these details make a production rendering difference reproducible.

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

There is no documented universal maximum height in the cited Puppeteer reference. Treat the height as a runtime-dependent engineering parameter: test representative documents, include a near-limit case in your deployment checks, and inspect page count and edge clipping after upgrades.

Best Value
HP LaserJet M110w Wireless Black & White Printer, Print, Fast speeds, Easy Setup, Mobile Printing, Best-for-Small Teams
  • FROM AMERICA'S MOST TRUSTED PRINTER BRAND – Perfect for small teams printing professional-quality black & white documents and reports. Perfect for 1-3 people
  • WORLD'S SMALLEST LASER IN ITS CLASS – Precision laser printing that fits anywhere
  • FAST PRINT SPEEDS – Up to 21 black-and-white pages per minute single-sided
  • WIRELESS WITH SELF-RESET – Helps you stay connected
  • PRINT FROM ANY DEVICE – Wireless printing from any mobile device, PC or tablet. Works with Microsoft, Mac, AirPrint, Android, Chromebook and more

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. A single GET request captures a URL as PNG, JPEG, WebP, or PDF, so you do not have to package Chromium and maintain a Puppeteer worker for every job. Its cleaner capture path accepts cookie or consent banners like a visitor, then removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.

For API parameters and PDF options, see the ScreenshotNeo documentation. The basic request below follows the supplied API form:

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

Python:

import requests

r = requests.get(
    'https://api.screenshotneo.com/v1/shot',
    params={'access_key': 'YOUR_API_KEY', 'url': 'https://stripe.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://stripe.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = Buffer.from(await res.arrayBuffer());
require('fs').writeFileSync('shot.webp', data);

ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. It includes full-page capture with lazy images loaded, custom viewport and device presets, print/PDF controls, custom CSS and JavaScript, selector waits, request blocking, authentication headers and cookies, geolocation and timezone, caching, signed links, asynchronous jobs, webhooks, bulk capture, and a usage API. Every feature is on every plan: the Free plan includes 1,000 shots per month with no card, and paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it without a card.

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

Frequently Asked Questions

Does Puppeteer document a maximum height for a custom one-page PDF?

No. The Puppeteer 25.12.0 option and PDF references describe custom width and height but do not publish a universal maximum. Validate the exact Chrome and Puppeteer runtime that will generate your files.

Which setting wins if I provide both a paper format and custom dimensions?

The documented API gives format priority over width and height. Omit format when the custom long-page dimensions are meant to apply.

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.