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

You can use one button to capture several elements in the current document with html2canvas: select the elements, call html2canvas(element) for each, and export each returned canvas. This does not automatically capture several URLs. If you mean separate web pages, you need a browser automation or screenshot service that can navigate to each URL.

What “multiple pages” means with html2canvas

html2canvas works from a page’s DOM. It reads accessible document elements and styles, then reconstructs them on a canvas; it does not take a native screenshot of browser pixels or navigate between URLs for you. Its documentation cautions that the result may not exactly match the browser rendering: html2canvas documentation.

Several sections or elements in one document

If your page contains several report panels, cards, or sections that should become separate image files, you can capture each element in turn from a single click. All targets must be present in, and accessible to, the current document.

Several distinct URLs

A client-side call cannot use html2canvas to visit arbitrary URLs. A same-origin application can load content it is permitted to access and capture its own DOM, subject to browser security rules. For automated capture across URLs, use a browser automation tool such as Puppeteer or Playwright, or a screenshot API that loads the URL on your behalf.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
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

Capture several elements with one button

Include the html2canvas library in your page using the installation method appropriate to your project. The following example assumes the library is loaded and that the target elements already exist when the script runs. Each element with class capture-page is exported as its own PNG.

const button = document.querySelector("#capture-all");
const targets = [...document.querySelectorAll(".capture-page")];

button.addEventListener("click", async () => {
  if (targets.length === 0) {
    console.warn("No elements matched .capture-page");
    return;
  }

  button.disabled = true;
  try {
    for (const [index, target] of targets.entries()) {
      try {
        const canvas = await html2canvas(target);
        const link = document.createElement("a");
        link.download = `capture-${index + 1}.png`;
        link.href = canvas.toDataURL("image/png");
        link.click();
      } catch (error) {
        console.error(`Capture ${index + 1} failed`, error);
      }
    }
  } finally {
    button.disabled = false;
  }
});

Example markup:

<button id="capture-all" type="button">Capture all sections</button>

<section class="capture-page">First report section</section>
<section class="capture-page">Second report section</section>

The loop is an implementation pattern using the library’s Promise-based API, not a built-in multi-page command. It awaits each capture before beginning the next, which keeps the workflow straightforward. The per-element try/catch allows later captures to continue if one target fails. Remove the inner error handler if a failure should stop the sequence instead.

Download behavior and user interaction

Browsers may limit multiple downloads initiated from one click, especially where the site has not been granted permission for repeated downloads. Test the flow in the browsers your users rely on. If the browser blocks some files, offer a ZIP assembled from the generated images or show a separate download link per image, rather than assuming every automatic download will be accepted.

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

For an interface with dynamic content, query the targets inside the click handler so the list reflects the latest DOM, and ensure the target elements are fully rendered before calling html2canvas. If one capture takes long enough for a user to click again, disabling the button during the operation prevents duplicate runs.

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.

Capture a long section and control rendering

html2canvas normally renders using the current window dimensions and a scale based on the device pixel ratio. Its configuration options let you adjust the rendering viewport and scale. For a long element, the project FAQ recommends setting windowWidth and windowHeight to the element’s scrollWidth and scrollHeight; this gives the renderer dimensions matching the content, but it does not lift browser canvas limits.

const canvas = await html2canvas(target, {
  windowWidth: target.scrollWidth,
  windowHeight: target.scrollHeight,
  scale: 1
});

Use a lower scale if a high-resolution capture produces too many pixels or consumes too much memory. Smaller scale reduces detail as well as output size, so inspect the saved image at its intended display size.

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.

Options that help with real pages

  • scale controls output resolution; its default is the device pixel ratio.
  • scrollX and scrollY set the scroll position used for rendering.
  • onclone lets you make changes to the cloned document before rendering, such as hiding transient content without changing the live page.
  • cullOffscreen can skip wholly offscreen elements when capturing a viewport-sized region.
  • Add data-html2canvas-ignore to controls or other nodes that should not appear in the rendered output.

See the configuration reference for the supported options. Use only settings you need: viewport dimensions, scale, scroll position, and clone-time adjustments affect what appears in the image.

Cross-origin images, iframes, and CSS fidelity

Images hosted on another origin

Browsers protect canvas content from cross-origin data that has not been permitted for use. With the default allowTaint: false, images that would taint the canvas are skipped. Setting useCORS: true may let html2canvas load an image from another origin only when that host supplies appropriate CORS headers; it cannot override the host’s policy. If you control the image host, configure CORS there. Otherwise, a properly configured proxy may be needed. The html2canvas FAQ describes these restrictions.

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

Iframes

A cross-origin iframe’s document is inaccessible to the parent page under browser security rules, so html2canvas cannot render its contents. Same-origin iframes can be supported recursively. If the content is third-party, use an authorized capture method that can access the page, rather than trying to bypass the browser boundary.

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

Visual differences

Because the library reconstructs the view from DOM and CSS rather than copying rendered pixels, some browser features or CSS may not render as expected. Compare the result in the browser and stylesheet combination you actually support. Do not promise pixel-perfect screenshots, and account for fonts, images, dynamic components, and effects that may render differently from the live page.

Canvas size, memory, and reliability

Very large canvases can be blank or partially rendered, sometimes without a useful exception. Maximum dimensions vary by browser, operating system, and hardware, so there is no single safe canvas size to promise. Capturing a long document as multiple smaller sections and lowering scale when necessary are practical mitigations. Validate output on the devices and browsers your users run.

Capturing one element at a time is usually easier to recover from than starting many large render jobs simultaneously. Concurrent captures may use substantial memory; there is no universal safe concurrency level. If you choose concurrency for speed, measure memory and failure behavior on representative pages.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

In a long-lived single-page application, the configuration reference documents clearImageCache as a way to clear the shared image cache after rendering and release loaded-image memory. Do not enable it while concurrent captures depend on the shared cache.

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

When to use a different capture method

Need Better fit Important distinction
Capture several accessible DOM elements in a page html2canvas Convenient in-page workflow, but it reconstructs from DOM and CSS.
Capture the visible tab in a browser extension Native extension screenshot API The html2canvas FAQ names chrome.tabs.captureVisibleTab() for Chrome, Edge, and Opera, and browser.tabs.captureVisibleTab() for Firefox. Extension permissions and API rules apply.
Generate screenshots on a server or visit distinct URLs Puppeteer or Playwright, or a screenshot API These approaches drive a browser rather than relying on the page’s client-side DOM and browser canvas.

html2canvas depends on browser APIs such as window, document, and computed styles, so it is not a server-side rendering solution by itself. For extension capture, a native tab screenshot API is more appropriate and avoids html2canvas canvas-size limits; it captures the visible tab rather than arbitrary DOM elements.

Or skip the browser setup

For screenshots of separate URLs, ScreenshotNeo provides a website screenshot API and MCP server. A single GET request can return a PNG, JPEG, WebP, or PDF. For example, use this cURL request to save a WebP:

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

For the full parameter list and other formats, see the ScreenshotNeo API documentation. The API can remove cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server gives AI agents screenshot tools. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for 1,000 free screenshots a month, with no card required.

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

Troubleshooting common failures

No files download

  • Check the browser’s multiple-download permission or prompt. Some browsers do not allow a page to trigger many downloads from one user gesture.
  • Confirm the click handler ran and that the selector found one or more targets.
  • Inspect the console for exceptions during rendering or toDataURL().

An image is missing or export fails

  • For cross-origin images, verify that the image server returns CORS headers suitable for the page; useCORS: true alone does not grant permission.
  • Check whether a cross-origin iframe is part of the target. Its contents cannot be accessed by html2canvas.
  • Reduce the captured area or scale if the canvas is too large and blank, incomplete, or unable to export.

The output differs from the visible page

  • Check whether the relevant CSS and browser features are supported by html2canvas.
  • Wait for fonts, images, and dynamic content before capture.
  • Use onclone to adjust the cloned DOM and inspect the image in the target browser, rather than changing the live page only for the capture.

Frequently asked questions

Can html2canvas save all captured sections as one image?

The pattern above creates one canvas and image per target. To create one combined image, you would need to compose the canvases onto another canvas yourself, accounting for their dimensions and layout; that combined canvas is subject to the same browser size and memory constraints.

Does one-button capture require a server?

No, not when all targets are accessible in the current page and client-side output is suitable. Use server-side browser automation when the job needs to navigate URLs independently or run outside a visitor’s browser.

Can html2canvas capture a full page?

It can render a tall element when given appropriate rendering dimensions, but browser canvas limits still apply. For lengthy content, splitting it into smaller targets is often more reliable than producing one enormous canvas.

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.

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