Set windowWidth and windowHeight to the target’s full scroll dimensions. For a scrollable element, this makes html2canvas render beyond the visible viewport:
const element = document.querySelector('#capture');
const canvas = await html2canvas(element, {
windowWidth: element.scrollWidth,
windowHeight: element.scrollHeight
});
This changes the rendering window; it does not turn html2canvas into a pixel-perfect browser screenshot. Independently scrolling children, fixed positioning, cross-origin assets, unsupported CSS, and browser canvas limits need separate treatment.
Capture an entire page, not just the visible viewport
html2canvas reconstructs a DOM subtree in a canvas. By default, its rendering window commonly follows the current viewport, so content below the fold can be clipped. Measure the complete document (or a page container) and pass those dimensions explicitly.
Whole-document example
async function capturePage() {
const root = document.documentElement;
const body = document.body;
const width = Math.max(root.scrollWidth, body.scrollWidth);
const height = Math.max(root.scrollHeight, body.scrollHeight);
const canvas = await html2canvas(body, {
windowWidth: width,
windowHeight: height,
scrollX: 0,
scrollY: 0,
scale: 1
});
const link = document.createElement('a');
link.download = 'full-page.png';
link.href = canvas.toDataURL('image/png');
link.click();
}
capturePage().catch(console.error);
Use a dedicated page wrapper instead of body when the wrapper owns the layout:
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
- PORTABLE SCANNER FOR USE ON-THE-GO — The fastest and lightest mobile single-sheet-fed compact document scanner in its class¹
- QUICK DOCUMENT SCANNING ― This Epson ultra-fast scanner scans a single page as quickly as 5.5 seconds²; Windows and Mac compatible
- VERSATILE PAPER HANDLING ― Portable scanner scans documents up to 8.5 x 72 in; Also easily digitizes receipts and ID cards to make accounting, bookkeeping, and organizing simpler
- INTUITIVE, HIGH-SPEED SOFTWARE — Epson ScanSmart Software³ is a smart tool allowing you to easily scan, review, and save; Stay organized easily with the help of this Epson scanner
- EASY SETUP — USB-powered connect to your computer for quick and simple scanning; No batteries or external power supply required to operate portable document scanner; Standard Connectivity: USB 2.0
const page = document.querySelector('#page');
const canvas = await html2canvas(page, {
windowWidth: page.scrollWidth,
windowHeight: page.scrollHeight
});
windowWidth and windowHeight are the dimensions used while html2canvas renders. They can change which responsive media queries match, so a very wide or tall value may produce a different layout from the one a user saw. If you need the desktop layout, choose the desktop CSS width deliberately; if you need the layout at a particular breakpoint, use that breakpoint’s width rather than blindly using the monitor’s size.
Screenshot a scrollable div with its hidden content
A page that scrolls and a child element with its own overflow: auto scroll area are different problems. Giving html2canvas the child’s scroll dimensions does not automatically make content hidden by the child’s clipping box visible. Prepare the cloned document with onclone, which lets you alter the copy used for rendering without changing the live page.
Rank #2
- FAST SPEEDS - Scans color and black and white documents a blazing speed up to 16ppm (1). Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
- ULTRA COMPACT – At less than 1 foot in length and only about 1. 5lbs in weight you can fit this device virtually anywhere (a bag, a purse, even a pocket).
- READY WHENEVER YOU ARE – The DS-640 mobile scanner is powered via an included micro USB 3. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan.
- WORKS YOUR WAY – Use the Brother free iPrint&Scan desktop app for scanning to multiple “Scan-to” destinations like PC, Network, cloud services, Email and OCR. (2) Supports Windows, Mac and Linux and TWAIN/WIA for PC/ICA for Mac/SANE drivers. (3)
- OPTIMIZE IMAGES AND TEXT – Automatic color detection/adjustment, image rotation (PC only), bleed through prevention/background removal, text enhancement, color drop to enhance scans. Software suite includes document management and OCR software. (4)
Expand the cloned scroll panel
async function capturePanel() {
const target = document.querySelector('.scroll-panel');
if (!target) throw new Error('Missing .scroll-panel');
const canvas = await html2canvas(target, {
windowWidth: target.scrollWidth,
windowHeight: target.scrollHeight,
onclone: clonedDocument => {
const clone = clonedDocument.querySelector('.scroll-panel');
if (!clone) return;
clone.style.height = `${clone.scrollHeight}px`;
clone.style.overflow = 'visible';
}
});
document.body.appendChild(canvas);
}
capturePanel().catch(console.error);
This pattern is layout-dependent. A panel whose descendants use fixed heights, sticky positioning, nested scroll containers, or JavaScript measurements may need additional cloned styles. Test the result against the live panel rather than assuming one override fixes every CSS scheme.
Tile a panel that cannot be expanded
When expanding the clone breaks the design, capture vertical sections and stitch them in your own canvas. Use the target’s scroll height to determine the number of tiles, pass a tile’s y and height to html2canvas, then draw each returned canvas at its corresponding offset. Keep each tile below practical canvas limits and avoid changing the panel’s width between captures. Tiling takes more time, but it works around a single enormous canvas and preserves layouts that depend on a fixed-height viewport.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsControl cropping, scale, and scroll position
These options solve different problems:
| Option | Purpose | Practical use |
|---|---|---|
windowWidth, windowHeight |
Rendering-window dimensions; they also affect media-query evaluation. | Set to a page or element’s scroll dimensions for beyond-viewport rendering. |
x, y, width, height |
Intentional crop of the rendered result. | Capture a known rectangle or one tile instead of the whole page. |
scale |
Output pixel density. | Use a lower value for very large pages; use a higher value only when the resulting pixel dimensions remain safe. |
scrollX, scrollY |
Scroll offsets used while positioning content. | Set deliberately when fixed or sticky elements must reflect a particular page scroll state. |
For a page that is currently scrolled, a zero offset anchors the render at the top in many layouts, but fixed and sticky elements can require an offset matching the intended state. The correct value depends on whether you want the header fixed to the viewport, positioned as if the page were at the top, or captured at its current scroll position.
Prevent blank or clipped canvases
Check the canvas dimensions first
Evergreen browsers have maximum canvas dimensions and maximum total canvas areas. The html2canvas FAQ gives approximately 32,767 pixels as a rough maximum dimension for Chrome/Chromium, Firefox, and desktop Safari, while warning that the real limit varies by browser, operating system, GPU, and available memory. Safari on iOS can be lower. The limit applies to output pixels, so a CSS height multiplied by scale can exceed it unexpectedly.
Rank #3
- FAST DOCUMENT SCANNING — Document scanner with feeder allows you to speed through stacks with a 50-sheet Auto Document Feeder (ADF); Efficient office scanner to help you scan more productively
- INTUITIVE, HIGH-SPEED SOFTWARE — Quickly scan with this desktop document scanner; Epson ScanSmart Software lets you easily preview scans, email files, upload to the cloud, and more; Plus, automatic file naming saves even more time
- SEAMLESS INTEGRATION — Easily incorporate your data into most document management software with the included TWAIN driver; Office document scanner integrates seamlessly with business workflows
- EASY SHARING — Duplex scanner allows you to scan straight to email or popular cloud storage2 services like Dropbox, Evernote, Google Drive, and OneDrive for simple storage and sharing
- SIMPLE FILE MANAGEMENT — Scanner allows the creation of searchable PDFs with Optical Character Recognition (OCR) and convert scans to editable Word or Excel files effortlessly; Designed for home and office document scanning
- Log the requested CSS width and height and multiply them by the chosen scale.
- Reduce
scaleto 1 or lower for exceptionally long pages. - Capture tiles and stitch them when one canvas would be too large.
- For reliable server-side full-page images, use browser automation that supports native full-page screenshots.
Make images readable to the browser
Set useCORS: true only when the image server sends an appropriate Access-Control-Allow-Origin header. Without that header, the browser’s same-origin policy still blocks the image from a clean canvas. With html2canvas’s default allowTaint: false, images that would taint the canvas are skipped rather than made usable. A same-origin image proxy is the alternative when you control the application architecture.
const canvas = await html2canvas(document.querySelector('#capture'), {
windowWidth: document.querySelector('#capture').scrollWidth,
windowHeight: document.querySelector('#capture').scrollHeight,
useCORS: true
});
Account for iframes and CSS fidelity
Cross-origin iframes cannot be rendered because browser security prevents access to their contentDocument. You must capture content from the framed origin itself or use a server-side browser that can navigate to the complete page. html2canvas also reconstructs the DOM from browser-readable styles; unsupported or partially supported CSS can differ from the on-screen rendering. Treat the output as a DOM-based rendering, not a native screenshot.
Rank #4
- Scanner type: Document
- Connectivity technology: USB
- With Auto Scan Mode, the scanner automatically detects what you're scanning
- Digitize documents and images
Know where html2canvas runs
html2canvas runs in a browser and depends on window, document, computed styles, and browser security rules. It is not a Node.js server-rendering library. For a backend job, the html2canvas documentation points to Puppeteer or Playwright, which control a real browser and can produce native full-page screenshots. That approach also avoids asking a user’s browser to allocate a giant canvas, but it adds browser installation, navigation, waiting, and operational work.
Choose the right capture approach
| Approach | Best fit | Main trade-off |
|---|---|---|
| ScreenshotNeo | Production screenshots from an API; clean shots, only clean shots billed, and the lowest paid plan. | Requires an API request and an access key rather than running in the page. |
| html2canvas | Client-side capture of DOM that your page can read, including a selected element. | DOM reconstruction, CORS/iframe restrictions, and browser canvas limits. |
| Puppeteer or Playwright | Server-side native browser screenshots and pages requiring browser automation. | You operate browser processes, resource limits, and navigation logic. |
Use html2canvas when the capture belongs in the user’s browser and the page is same-origin or CORS-ready. Use a real-browser service when fidelity, cross-origin content, or repeatable backend execution matters more than avoiding infrastructure.
Best Value
- OUR MOST ADVANCED SCANSNAP. Large touchscreen, fast 45ppm double-sided scanning, 100-sheet document feeder, Wi-Fi and USB connectivity, automatic optimizations, and support for cloud services. Upgraded replacement for the discontinued iX1600
- CUSTOMIZABLE. SHARABLE. Select personalized profiles from the touchscreen. Send to PC, Mac, mobile devices, and clouds. QUICK MENU lets you quickly scan-drag-drop to your favorite computer apps
- STABLE WIRELESS OR USB CONNECTION. Built-in Wi-Fi 6 for the fastest and most secure scanning. Connect to smart devices or cloud services without a computer. USB-C connection also available
- PHOTO AND DOCUMENT ORGANIZATION MADE EFFORTLESS. Easily manage, edit, and use scanned data from documents, receipts, photos, and business cards. Automatically optimize, name, and sort files
- AVOIDS PAPER JAMS AND DAMAGE. Features a brake roller system to feed paper smoothly, a multi-feed sensor that detects pages stuck together, and skew detection to prevent paper damage and data loss
Common failures and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| Only the visible area appears. | The rendering window follows the viewport. | Set windowWidth and windowHeight to the target’s scroll dimensions. |
| A scrollable child is still clipped. | Its own overflow container remains constrained. | Use onclone to expand the cloned child, or capture and stitch tiles. |
| The canvas is blank. | Canvas width/height or total area exceeded a browser limit. | Lower scale, reduce the capture region, or tile it. |
| Images are missing. | Cross-origin responses lack CORS headers. | Enable useCORS when headers are present; otherwise proxy images through your origin. |
| An iframe is empty. | The iframe is cross-origin. | Capture from the iframe’s own origin or use browser automation. |
| Fixed or sticky elements are misplaced. | The chosen scroll offsets do not match the desired state. | Set scrollX and scrollY deliberately and test at the intended scroll position. |
| Styles differ from the page. | html2canvas does not implement every CSS feature as a native browser capture. | Simplify or override unsupported styles in onclone, or switch to a native browser screenshot. |
| The call fails on the server with “window is not defined.” | html2canvas was invoked outside a browser. | Run it in a browser, or move the job to Puppeteer, Playwright, or an image API. |
Or skip the browser setup
ScreenshotNeo returns a PNG, JPEG, WebP, or PDF from one request. It accepts cookie and consent banners as a visitor, then removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be disabled. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the result with X-Page-Verdict and X-Billed headers.
For a direct image request (see the ScreenshotNeo API documentation):
Free tools Windows power users keep installed
One-click scans. No signup required.
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)
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}`);
const buffer = Buffer.from(await res.arrayBuffer());
require('fs').writeFileSync('shot.webp', buffer);
The API also supports full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets and custom viewports, retina scale, PDF paper settings and page ranges, custom CSS or JavaScript, pre-capture clicks, selector waits, delays or network-idle waits, ad/tracker/request blocking, custom headers/cookies/user agents and Authorization, timezone and geolocation, transparent backgrounds, resizing, selectable-TTL caching, signed public image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, an OpenAPI specification, and familiar parameter names for easier migration. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients, so an AI agent can capture pages without custom browser code.
| Plan | Included shots | Price |
|---|---|---|
| Free | 1,000 per month | $0, no card |
| Starter | 3,000 | $5 |
| Growth | 15,000 | $15 |
| Pro | 60,000 | $39 |
| Scale | 250,000 | $99 |
| Business | 1,000,000 | $249 |
Every feature is included on every plan, and yearly billing provides two months free. You can sign up for 1,000 free screenshots a month with no card.
Frequently Asked Questions
Does html2canvas capture the browser address bar or other browser chrome?
No. It renders the web page’s DOM; browser UI, the address bar, and the operating system’s window chrome are outside the document.
Must I scroll the live page to the bottom before calling html2canvas?
No. For document content, set the rendering window to the required scroll dimensions. Scrolling the live page is only relevant when you intentionally want a particular fixed or sticky state.
Can increasing scale reveal content that is below the fold?
No. scale changes output pixel density. Use windowWidth/windowHeight, clone preparation, or tiling to include more content.
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.

