iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
To put a whole webpage on one PDF page with Puppeteer, render it using a PDF page size tall enough for its content, then check that it fits and remains readable. Puppeteer has no documented one-page switch for arbitrary websites: choose print or screen styling, set paper dimensions and margins, and tune the PDF scale within its documented 0.1–2 range.
What “one PDF page” means
A PDF page has fixed dimensions. A webpage, by contrast, can grow as its content loads. Fitting the entire page onto one sheet therefore means either using an unusually tall custom sheet or shrinking the rendered page to fit a chosen sheet. These choices have different trade-offs: a tall sheet can preserve larger text, while shrinking to Letter or A4 may make a long page difficult to read.
Puppeteer’s page.pdf() generates output with print CSS media by default. The API exposes paper dimensions, orientation, margins and scale, but does not define a universal option that automatically measures every arbitrary website and guarantees a legible one-page result. See the PDFOptions interface and Page.pdf() documentation.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Choose print or screen styling
Use print media for a print-oriented PDF
Leave the default media behavior in place when the site’s print stylesheet is the desired output. Print CSS may hide navigation, change layout, or simplify colors and backgrounds. That can make a better document, but it may not resemble the page as it appears in a browser window.
#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
Use screen media to preserve screen rules
If you want the screen layout, call page.emulateMediaType('screen') before page.pdf(). This changes which CSS media rules are applied; it does not guarantee that the screen layout will fit on one sheet. You still need to select suitable dimensions and inspect the generated PDF.
Set up Puppeteer and capture a page
The example below uses Puppeteer’s JavaScript API. Install Puppeteer in a Node.js project using your preferred package manager, then save the script as an .mjs file and run it with Node. Puppeteer’s PDF options and their defaults are documented in the official PDFOptions reference. Because content height varies by site, replace the sample dimensions after measuring the target page.
import puppeteer from 'puppeteer';
const url = 'https://example.com';
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
await page.setViewport({ width: 1280, height: 900 });
await page.goto(url, { waitUntil: 'networkidle0', timeout: 60000 });
// Keep print media by default. For screen styling instead, uncomment:
// await page.emulateMediaType('screen');
const dimensions = await page.evaluate(() => {
const root = document.documentElement;
const body = document.body;
return {
width: Math.max(root.scrollWidth, body?.scrollWidth ?? 0),
height: Math.max(root.scrollHeight, body?.scrollHeight ?? 0),
};
});
// These are CSS dimensions, not a universal page-height formula.
// Adjust after checking the rendered PDF for your target page.
const widthInches = 8.5;
const heightInches = Math.max(11, dimensions.height / 96);
await page.pdf({
path: 'webpage.pdf',
width: `${widthInches}in`,
height: `${heightInches}in`,
margin: { top: 0, right: 0, bottom: 0, left: 0 },
scale: 1,
printBackground: true,
preferCSSPageSize: false,
});
} finally {
await browser.close();
}
The script measures the document’s screen-layout scroll dimensions after navigation and uses the measured height as a starting point for a custom sheet. It is not a guarantee of the final print-layout height: print CSS can change dimensions, late-loading content can alter the page, and CSS overflow or fixed-position elements may not be represented as expected by a simple scroll measurement. Treat the output as a draft, then check its page count, clipping and text size.
The conversion from CSS pixels to inches in the example is a practical starting estimate, not a formula specified by Puppeteer for every page. If the print layout is the target, measure and tune against that layout rather than assuming the screen measurement predicts it exactly.
Choose the page size and scale deliberately
Standard paper versus custom dimensions
You can select a named format such as Letter or specify explicit width and height. The format defaults to Letter when a paper format is used and explicit dimensions do not supersede it. A standard sheet is convenient for printing, but a long webpage may be scaled down to fit. A custom height can accommodate more content at a larger scale, but it may be impractical for ordinary printers or PDF workflows.
Rank #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⁴
Understand scale and CSS page sizing
The documented scale default is 1, and its supported range is 0.1 through 2. Lowering it shrinks the rendering; raising it enlarges it. It is not unlimited, and very small scale does not make a long page readable simply because all content fits.
preferCSSPageSize defaults to false. With that setting, content is scaled to fit the paper size selected in the PDF options. Set it to true when the page’s CSS @page rule should take priority over the PDF API’s width, height, or format. Avoid specifying conflicting dimensions without deciding which source should govern the sheet.
Free tools Windows power users keep installed
One-click scans. No signup required.
Margins, backgrounds and colors
Puppeteer leaves margins unset by default. Explicitly set them when the usable area matters, including zero margins when you want the selected sheet’s full area available. printBackground defaults to false; set it to true when background graphics are part of the design. PDF rendering can adjust colors for print; the documentation identifies -webkit-print-color-adjust for forcing exact colors where needed.
Other PDF options that affect the result
landscapeselects orientation when using paper formats; consider it if a page is much wider than it is tall.pageRangesdefaults to an empty value, which means all pages are printed. It can restrict output to specified page ranges, but does not make an oversized page fit on one page.waitForFontsdefaults totrue; Puppeteer waits fordocument.fonts.readyto resolve. This can help avoid output captured before web fonts finish loading.
These defaults and limits are API semantics documented by Puppeteer, not guarantees that a particular site will produce a one-page PDF. The Puppeteer Core 24.42.0 PDFOptions source is a version-specific reference; check the documentation and installed Puppeteer/Chromium versions used by your project.
Make a long page fit without losing the content
- Decide what appearance you need. Keep print media for print-specific layout, or emulate screen media before generating the PDF.
- Wait for the page to settle. Choose an appropriate navigation wait condition for the site. A dynamic page may continue changing after navigation resolves; if it does, wait for a meaningful selector or add an application-specific readiness check before measuring.
- Measure the rendered page. Use the document dimensions as a starting point, but account for changes caused by print styles, overflow and late content.
- Choose the sheet dimensions. Use a standard format if the PDF must fit familiar paper, or a custom height if one long sheet is acceptable. Keep the width and height in compatible units.
- Set scale and margins. Start with a scale of 1 and reduce it only as needed; the documented range is 0.1–2. Remove margins when maximizing the usable area is important.
- Generate and inspect the PDF. Confirm the page count, check the top and bottom edges for clipping, and zoom in to judge whether text is readable. Adjust dimensions or scale and regenerate if necessary.
One page and readable text are separate goals. If a complete long page will not fit legibly on the required standard paper size, use a taller sheet, accept multiple pages, or change what content the page includes rather than assuming a lower scale solves the problem.
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.
Troubleshooting common one-page failures
The PDF still has multiple pages
Check whether the selected dimensions actually contain the rendered content and whether a CSS @page rule is overriding the API dimensions. With preferCSSPageSize: true, CSS page size takes priority; with the default false, content is scaled to fit the PDF-selected paper dimensions. Inspect the PDF’s actual page count instead of assuming the configuration guarantees one sheet.
Windows 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 reinstallOutdated 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 matchThe bottom of the page is missing
The measured height may not include content that appeared later, or the chosen print layout may be taller than the screen layout you measured. Wait for the relevant content to load, measure using the intended media styling, and increase the custom height if inspection confirms clipping.
The page is one sheet but the text is tiny
A long page scaled onto a standard sheet can become unreadable. Use a larger custom sheet or allow more than one page. Puppeteer documents a scale minimum of 0.1, but that lower limit is not a recommendation for legibility.
The PDF looks different from the browser
page.pdf() uses print media by default. If you need screen styling, call page.emulateMediaType('screen') before generating the PDF. Also check whether print CSS, background printing, or color adjustment changes the appearance you expect.
Images, fonts or other content are missing
Navigation completion does not always mean every application-specific asset or lazy-loaded element is ready. Wait for the needed selector or condition before measuring and exporting. Puppeteer’s default waitForFonts: true waits for document fonts to resolve, but it does not make every other resource load successfully.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsRank #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
The PDF call rejects an option
Confirm the option name and supported values against the documentation for the Puppeteer version in your project. In particular, keep scale between 0.1 and 2, and avoid relying on behavior not established for the installed version. The versioned 24.42.0 type source is useful only as a cross-check for that package version.
Performance, reliability and cost considerations
Every capture requires launching or using Chromium, loading the target page and producing a PDF. Page complexity, network response, fonts and scripts all affect completion time; the documentation does not establish a universal runtime or a one-page sizing formula. Use an appropriate navigation timeout, make readiness specific to the site, and handle failures so a timeout does not leave the browser running. The example closes its browser in a finally block.
For repeatable output, keep the Puppeteer and Chromium versions controlled in the environment and inspect representative pages whenever those versions, site content or print styles change. A page that is dynamic or personalized may render differently between requests. The API references describe option behavior; they do not establish identical results across all versions and sites.
Or skip the browser setup
If you need a screenshot or PDF without maintaining Puppeteer and Chromium, ScreenshotNeo offers a website screenshot API and MCP server. For example, request a PDF with a single GET call; see the ScreenshotNeo documentation for API parameters and output options.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://stripe.com
-d format=pdf
-o webpage.pdf
- It accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each step can be turned off.
- Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing; responses identify the page verdict and billing status in headers.
- Its MCP server provides
take_screenshot,get_page_infoandcapture_pdftools for AI agents, including Claude, Cursor and other MCP clients. - The free plan includes 1,000 screenshots per month with no card required. Paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.
Frequently Asked Questions
Does Puppeteer have a one-page PDF option?
No universal one-page option is documented. Choose page dimensions and scale for the target page, then inspect the generated PDF.
Can I use CSS @page to set a custom PDF page size?
Yes. Set preferCSSPageSize: true when CSS page sizing should take priority over dimensions specified in the PDF options.
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.

