October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
browser automation

How to Take Puppeteer Screenshots With Zoom and Custom Scale

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

To zoom a Puppeteer screenshot, change the page’s CSS before capturing it; to make the image denser or sharper, set deviceScaleFactor in the viewport. They solve different problems: CSS zoom can change layout and wrapping, while device scale factor increases the number of output pixels per CSS pixel. Set the viewport before navigation, apply any visual zoom after the target content loads, then choose a viewport, full-page, clipped, or element screenshot.

What “zoom” and “scale” mean in Puppeteer

Puppeteer does not document a zoom option in page.screenshot(). To enlarge page content, apply CSS in the page or use a transform. To increase raster density without asking the page to lay itself out at a different CSS viewport size, set deviceScaleFactor in page.setViewport().

Control What it changes Use it when Important trade-off
width and height Viewport dimensions in CSS pixels. You need a particular responsive layout or visible window size. Changing viewport dimensions can change breakpoints and wrapping.
CSS zoom How page content is laid out and painted. You want text and components to appear larger or smaller. Wrapping, fixed-position elements and document dimensions can change.
deviceScaleFactor Device pixels per CSS pixel. You want a denser image while keeping the CSS viewport dimensions fixed. It is not browser zoom; the output image may use more memory and storage.
CSS transform Visual rendering of the transformed element or subtree. You need to magnify a particular element or controlled region. Transforms do not necessarily change layout flow, so clipping and sizing need care.

A useful planning estimate is output pixels ≈ rendered CSS dimensions × deviceScaleFactor. It is an approximation: full-page dimensions, clipping, fractional layout values and browser rendering can affect final dimensions.

Set viewport size and device scale factor

Use page.setViewport({ width, height, deviceScaleFactor }). The width and height are CSS-pixel values, and deviceScaleFactor defaults to 1. Puppeteer recommends setting the viewport before navigation: some pages do not expect device characteristics to change after loading, and changing them later can trigger a reload.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({ headless: true });
try {
  const page = await browser.newPage();

  await page.setViewport({
    width: 1280,
    height: 900,
    deviceScaleFactor: 2,
  });

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

  await page.screenshot({
    path: 'retina.png',
    type: 'png',
  });
} finally {
  await browser.close();
}

Here the page has a 1280-by-900 CSS-pixel viewport, while the device scale factor requests two device pixels per CSS pixel. Use a factor of 1 when you want ordinary density; choose a larger factor when downstream use benefits from more pixels. Higher density can increase file size and memory needs, particularly when combined with full-page capture.

Apply visual zoom with CSS

After navigation and after the content you intend to capture exists, set CSS zoom on the document root. For example, 125% enlarges the page visually. Because it affects layout and paint, check the resulting wrapping, fixed elements and page dimensions rather than assuming the original layout remains unchanged.

await page.evaluate(() => {
  document.documentElement.style.zoom = '125%';
});

await page.screenshot({ path: 'zoomed.png', fullPage: true, type: 'png' });

If the site uses scripts that later rewrite styles, wait until its rendering work is complete before applying the zoom and capture. For dynamic content, wait for the relevant selector and, where needed, for fonts, images or client-rendered data to become ready. These are workflow waits; they are not screenshot options.

When a transform is preferable

A CSS transform can magnify a subtree rather than the whole document, but it does not necessarily reserve extra layout space for the transformed content. This can cause overlap or make a crop cut off part of the magnified element. If you choose a transform, calculate the target’s rendered bounds and set the screenshot clip accordingly; verify the result at the exact viewport and scale used in production.

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

Choose viewport, full-page, clipped or element capture

Capture scope determines what appears in the file and how much content Puppeteer must render. The documented screenshot options include fullPage, clip, and captureBeyondViewport; fullPage is false by default.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Capture mode Example Best for Considerations
Visible viewport await page.screenshot({ path: 'viewport.png' }) A screenshot of the currently visible window. Output follows viewport size and device scale; no full-document capture is requested.
Full document await page.screenshot({ path: 'full.png', fullPage: true }) A page capture that extends beyond the visible viewport. Tall pages and high density can require more memory and produce large files.
Exact region await page.screenshot({ path: 'region.png', clip: { x: 0, y: 100, width: 640, height: 400 } }) A chart, section or known rectangle. Clip coordinates and dimensions must match the rendered content; zoom and scale affect planning.
One element Get an element handle, then call its screenshot method. A card, chart, component or other single target. Wait for the element to exist and be visible; inspect the captured bounds if CSS zoom or transforms are used.

For a clipped capture that extends outside the viewport, captureBeyondViewport controls capture beyond the viewport. Keep clip coordinates deliberate after applying visual zoom, since the rendered dimensions may differ from the unzoomed page.

Capture a specific element

Use an element handle when the target is a component rather than an arbitrary rectangle. The following example waits for the selector, scrolls it into view, and captures that element:

const card = await page.waitForSelector('.report-card', { visible: true });
if (!card) throw new Error('Report card was not found');
await card.screenshot({ path: 'report-card.png', type: 'png' });

Replace .report-card with a selector that uniquely identifies your target. If the page populates the component asynchronously, wait for a meaningful ready state before taking the element screenshot.

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

Complete runnable example: zoomed full-page PNG

This ES module example sets viewport metrics first, loads a page, waits for a selector that represents the content, applies CSS zoom, and writes a full-page PNG. Install Puppeteer in your project with npm install puppeteer, save the code as an .mjs file and run it with Node.js.

import puppeteer from 'puppeteer';

const url = 'https://example.com';
const browser = await puppeteer.launch({ headless: true });

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

  // Width and height are CSS pixels; deviceScaleFactor controls raster density.
  await page.setViewport({
    width: 1280,
    height: 900,
    deviceScaleFactor: 2,
  });

  await page.goto(url, { waitUntil: 'networkidle2' });

  // Replace this with a selector that signals your target content is ready.
  await page.waitForSelector('body');

  // Visual zoom changes page layout/painting; it is not output-density scaling.
  await page.evaluate(() => {
    document.documentElement.style.zoom = '125%';
  });

  await page.screenshot({
    path: 'zoomed-full-page.png',
    fullPage: true,
    type: 'png',
  });
} finally {
  await browser.close();
}

For a viewport-only capture, omit fullPage: true. For a region, replace the capture options with a clip rectangle. For an element, wait for its selector and call the element handle’s screenshot() method. Keep the viewport setup before goto() in each variant.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Output format, quality and transparency

Make the output type explicit so later processing does not depend on defaults. Puppeteer documents PNG as the default image type; screenshot options also include quality for formats that support lossy quality settings, omitBackground for transparency, path for file output, and binary or base64 return modes.

  • Use PNG for lossless raster output and predictable handling of text or interface details.
  • Use a lossy format only when its smaller output is worth the quality trade-off; set quality only for a format that supports it.
  • Set omitBackground: true when a transparent background is needed and the page content supports that result.
  • Use path to write directly to a file, or consume the returned data when the image needs to be processed in memory.

Increasing deviceScaleFactor and capturing a long full page both increase the amount of pixel data involved. If a job is too large for your environment, first reduce the capture scope or output density, then consider a lossy format when acceptable.

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

Common problems and fixes

The image is sharper, but content is not larger

You changed deviceScaleFactor, which increases raster density rather than applying browser-style zoom. Set CSS zoom if you want content to render larger; keep the scale factor for pixel density.

Text wraps differently or fixed elements move

CSS zoom changes layout and painting. Review the page at the zoomed state and adjust the viewport or capture scope as needed. A transform can magnify a subtree, but may not change the layout space it occupies.

The screenshot has the wrong responsive layout

Set the intended CSS viewport width and height before page.goto(). A larger device scale factor does not substitute for a wider CSS viewport.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

The capture is clipped or has unexpected dimensions

Check whether you requested the viewport, full page or a clip. Recalculate the clip after applying CSS zoom; for captures beyond the viewport, review captureBeyondViewport. Element screenshots can avoid guessing a rectangle when the target is a specific component.

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

The page is blank or missing dynamic content

Navigation completion does not guarantee that client-rendered data, images or fonts are ready. Wait for a selector that indicates the target is present, and add page-specific readiness checks before taking the screenshot.

Changing the viewport causes a reload or changes the page

Move setViewport() before navigation. Puppeteer recommends this order because some pages react unexpectedly when device characteristics change after load.

The output file is unexpectedly large or the process runs out of memory

Full-page capture includes more rendered area than a viewport capture, and a higher scale factor means more device pixels. Reduce scope or density, or select a supported lossy image format with a suitable quality setting.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you do not need to manage Chromium and page timing yourself, ScreenshotNeo offers a screenshot API: one GET request with a URL returns an image or PDF. Its capture can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups and chat widgets before the shot; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, with X-Page-Verdict and X-Billed response headers indicating the result. Its MCP server provides take_screenshot, get_page_info and capture_pdf tools for AI agents and MCP clients.

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.

cURL example, using the documented endpoint and parameters (see the ScreenshotNeo API documentation):

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. See ScreenshotNeo for the service and plan details. Sign up for free and get 1,000 screenshots a month with no card.

Choosing between visual zoom and higher density

Decide based on what should change in the result: use CSS zoom when the page content itself should look larger, and use deviceScaleFactor when the layout should stay tied to the same CSS viewport but the raster should contain more pixels. Use both only when you want both effects, and inspect the final capture because zoom can affect document size and clipping while scale affects pixel output.

For a fixed component, an element screenshot is often simpler than deriving a clip rectangle. For a whole long page, fullPage: true avoids manual scrolling but can produce a much larger image. For a visible-window capture, leave full-page mode off. In every case, set viewport metrics before navigation and take the screenshot only after the content you need is ready.

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

Frequently Asked Questions

Does Puppeteer have a screenshot zoom option?

No documented ScreenshotOptions field sets visual zoom. Apply CSS zoom or a deliberate transform in the page before capturing.

Can I use deviceScaleFactor and CSS zoom together?

Yes. They control separate things: CSS zoom changes page rendering and layout, while deviceScaleFactor sets device-pixel density.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.