DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
Canvas

How to Fix Empty Canvases Returned by html2canvas

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.

An empty html2canvas result usually has a specific cause: the requested canvas exceeds a browser limit, an image is blocked by cross-origin policy, or html2canvas cannot reproduce part of the DOM or CSS. Inspect the returned canvas dimensions first, then isolate images and unsupported styles. For a full-page capture, match windowWidth and windowHeight to the element’s scroll dimensions; for oversized pages, capture smaller regions or reduce scale.

Start with the canvas dimensions

html2canvas resolves a promise even when the resulting bitmap is blank or only contains part of the target. Read the actual pixel dimensions immediately after capture:

html2canvas(document.querySelector('#report')).then(canvas => {
  console.log({
    width: canvas.width,
    height: canvas.height,
    cssWidth: canvas.style.width,
    cssHeight: canvas.style.height
  });
  document.body.appendChild(canvas);
});

Compare canvas.width and canvas.height with the dimensions you intended to export. A high-DPI device can multiply CSS dimensions because scale defaults to window.devicePixelRatio. A 12,000 CSS-pixel element at a device-pixel ratio of 2 requests roughly 24,000 bitmap pixels in each direction, not 12,000.

Cause 1: the canvas is too large

The html2canvas FAQ warns that an oversized canvas can become blank or be cut off without an error. The limits are implementation- and device-dependent. Its rough guide lists the following indicative values, not guarantees for every browser or platform:

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.
#1 Best Overall
Wacom Intuos Small, Wired Graphic Drawing Tablet with Pen + Software
  • Wacom Intuos Small Graphics Drawing Tablet: Enjoy industry leading tablet performance in superior control and precision with Wacom's EMR, battery free technology that feels like pen on paper
  • Works With All Software: Wacom Intuos tablet can be used in any software program to explore new facets of digital creativity; draw, paint, edit photos/videos, create designs, and mark up documents
  • What the Professionals Use: Wacom's industry leading pen technology and pen to paper feeling makes it the preferred drawing tablet of professional graphic designers
  • Software and Training Included: Only Wacom gives you software with every purchase. Register your Intuos tablet and gain access to some of the best creative software and Wacom's online training
  • Wacom is the Global Leader in Drawing Tablet and Displays: For over 40 years in pen display and tablet market, you can trust that Wacom to help you bring your vision, ideas and creativity to life
Environment Approximate maximum dimension Approximate maximum area
Chrome/Chromium 32,767 px 268 million pixels
Firefox 32,767 px 472 million pixels
Desktop Safari 32,767 px Similar to Chrome
iOS Safari Lower and device-dependent Depends on available device RAM

The project describes these as rough, current guidance; browser and platform limits change. The canvas-size project’s browser tests are a better source when you need a device-specific ceiling.

Capture the full scroll area deliberately

If the element is meant to be captured at its complete scroll size, set the rendering window to those dimensions. This also lets media queries evaluate as though the viewport is large enough for the content:

const element = document.querySelector('#report');
const width = element.scrollWidth;
const height = element.scrollHeight;

html2canvas(element, {
  windowWidth: width,
  windowHeight: height,
  width,
  height,
  onclone: clonedDocument => {
    // Optional: adjust the clone without changing the live page.
  },
  onError: error => console.error('html2canvas resource error', error)
}).then(canvas => {
  document.body.appendChild(canvas);
});

Do not assume those settings can bypass a bitmap limit. If the calculated width, height, or total pixels is too large, the reliable remedy is to reduce the request.

Reduce scale or split the target

Try scale: 1 instead of the default device-pixel ratio as a diagnostic:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
XPPen Deco 01 V3 10x6 Drawing Tablet, 16K Battery-Free Stylus, 8 Keys
  • Word-first 16K Pressure Levels: The upgraded stylus features 16,384 levels of pressure sensitivity and supports up to 60 degrees of tilt, delivering smoother lines and shading for a natural drawing experience. With no battery or charging needed, it operates like a real pen, making it easy for beginners to create effortlessly. This functionality helps novice artists develop their skills and explore their creativity without the intimidation of complex tools
  • Designed for Beginners: This drawing pad desinged with 8 customizable shortcuts for both right and left-hand users, express keys create a highly ergonomic and convenient work platform
  • Perfectly Adapted for Android: The XPPen Deco 01 V3 art tablet supports connections with Android devices running version 10.0 and above. It is recommended to download the XPPen Tools Android application, which adapts to your smartphone's screen aspect ratio, ensuring accurate mapping. It also supports mapping on Android screens with different aspect ratios in portrait mode
  • Large Drawing Space, Bigger Bold Inspiration: This expansive drawing pad has10 x 6.25-inch helps you break through the limit between shortcut keys and drawing area
  • Easy Connectivity for Beginners: The Deco 01 V3 offers USB-C to USB-C connectivity, plus adapters for USB C. This ensures easy connection to various devices, allowing beginner artists to set up quickly and focus on their creativity without compatibility concerns. Whether using a laptop, tablet, or desktop, the Deco 01 V3 provides a seamless experience, making it an ideal choice for those just starting their digital art journey
html2canvas(element, {
  scale: 1,
  windowWidth: element.scrollWidth,
  windowHeight: element.scrollHeight
});

Lower scale trades physical pixels for a smaller, more memory-friendly image; it does not fix cross-origin images or unsupported CSS. For very tall documents, render separate sections and stitch them in a controlled workflow, or export several images instead of one enormous bitmap. Start with a small region that reproduces the failure, then increase its size until you find the practical boundary on the target browser and device.

Cause 2: cross-origin images are skipped

With allowTaint: false, the default, html2canvas avoids drawing an image when doing so would taint the canvas. A missing remote logo, avatar, background image, or chart texture can therefore make the output look incomplete. Temporarily replace remote images with same-origin files or remove them from the DOM. If the capture becomes correct, investigate the image response rather than the canvas code.

Use CORS only when the server grants it

Set useCORS: true when the image server returns an appropriate Access-Control-Allow-Origin header:

html2canvas(document.querySelector('#report'), {
  useCORS: true,
  onError: error => console.error(error)
}).then(canvas => {
  const link = document.createElement('a');
  link.download = 'report.png';
  link.href = canvas.toDataURL('image/png');
  link.click();
});

The option requests a CORS-enabled image; it cannot override the remote server’s policy. The header must be present on the image response, and credentials require a compatible, explicit origin configuration. If you do not control that server, route the image through a proxy that you control and that returns it under a same-origin or permitted CORS URL.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
HUION Inspiroy H640P 6x4 inch Drawing Tablet 8192 Pen Pressure
  • Customize Your Workflow: The 6 customizable press keys on Huion H640P drawing tablet for pc let you assign your most-used commands—like undo, zoom, brush switch, or save—so you can keep your hands on the tablet and your mind on the art. Whether you're a digital painter switching brushes, or a comic artist zooming in and out, these keys keep your workflow smooth and uninterrupted. Plus, the Huion driver lets you save different shortcut profiles for different apps, so you never have to reconfigure when switching software.
  • Professional Pen Performance: Huion H640P drawing pad for computer comes with the battery-free PW100 stylus that's always ready when inspiration strikes. With 8192 levels of pressure sensitivity, every light sketch, or bold stroke responds naturally to your hand—just like a real pen. The 5080 LPI resolution and 233 PPS report rate deliver lag-free, precise strokes, so you can draw confidently without second-guessing your cursor. The pen side buttons help you switch between pen and eraser instantly.
  • Compact and Portable: Huion H640P computer graphics tablet features a compact, ultra-portable design at just 0.3 inches thin and 0.61 lbs light, so it slides easily into your backpack—perfect for sketching in coffee shops, taking notes in class, or editing on the go between home and studio. The 6x4 inch active area offers enough room for natural pen movements while fitting comfortably on crowded desks, or lecture hall seats.
  • Stable Compatibility: Huion H640P graphic drawing tablet works seamlessly with Mac, Windows, Linux PCs, and Android smartphones/tablets (OS version 6.0 or later). Left-handed friendly, and you just need to flip the tablet and adjust the settings in the driver. Please note: H640P does NOT support iPhone/iPad.
  • Move Beyond the Mouse: Huion Inspiroy H640P is a pen tablet that replaces your mouse for more natural, precise control. Freehand draw, take notes, or even play OSU—everything you do with a mouse, you can do better with a pen. The precise tip makes it ideal for detailed photo editing, graphic design, or signing PDF. Meanwhile, the ergonomic pen grip helps you avoid the strain that comes from hours of using a mouse.

Why allowTaint: true is not an export fix

Allowing a tainted image may let the browser draw it, but a tainted canvas cannot safely be read with toDataURL(), toBlob(), or pixel APIs. Use server-side CORS headers or a properly configured proxy instead of treating allowTaint: true as a way to obtain a downloadable image.

Cause 3: html2canvas cannot reproduce the DOM exactly

html2canvas is a DOM renderer, not a screenshot API. It traverses the document and rebuilds a representation from the properties it implements. The html2canvas documentation states: “Every CSS property must be manually implemented to render correctly, so html2canvas will never have full CSS support.” A visible browser result can therefore differ in the canvas, even when dimensions and CORS are correct.

Isolate unsupported markup and styles

  1. Capture the smallest subtree that still fails.
  2. Temporarily remove complex filters, masks, blend modes, unusual transforms, and other advanced effects.
  3. Replace web fonts and remote backgrounds with local, simple equivalents.
  4. Compare each reduced capture with the live page, then add features back one at a time.

This process distinguishes a renderer limitation from a loading problem. If a particular effect is essential and must match browser pixels exactly, use a browser-driven screenshot system rather than expecting html2canvas to implement every CSS property.

A repeatable browser-side diagnostic

  1. Confirm the target. Verify that the selector returns the intended, visible element and that it has non-zero scrollWidth and scrollHeight.
  2. Log bitmap dimensions. Check canvas.width and canvas.height, including the effect of scale.
  3. Test a small region. Capture a child element or set scale: 1. If that works, size or memory pressure is likely.
  4. Match scroll dimensions. For a full-scroll capture, pass the element’s scrollWidth and scrollHeight as windowWidth and windowHeight.
  5. Remove remote images. If the output changes, inspect image CORS headers, then use useCORS: true or a proxy.
  6. Reduce CSS. Simplify the smallest failing subtree and check the library’s supported features.
  7. Inspect errors. Supply onError and watch the browser console and network panel for failed resources.

Common symptoms and fixes

Symptom Likely cause Action
Completely blank canvas, no exception Requested width, height, or area exceeds the browser’s canvas limit Log dimensions, set intended scroll window values, then lower scale or capture smaller regions.
Top portion renders, lower portion is missing Element is taller than the practical bitmap limit Split the capture; do not keep increasing height.
Text and boxes appear, images do not Cross-origin image was skipped Use same-origin assets, CORS headers with useCORS: true, or a proxy.
Export throws a security error The canvas was tainted by an image Fix CORS or proxy handling; do not rely on allowTaint: true.
Layout differs from the page Unsupported or partially supported CSS/DOM feature Simplify the style, check supported features, or use a browser screenshot.
Code works in a browser but fails in Node.js html2canvas requires window, document, and computed styles Run it client-side or move server capture to Puppeteer or Playwright.

When to use a server-side browser instead

html2canvas is a browser-side library. It depends on browser APIs and is not suitable for direct Node.js execution. For server-rendered screenshots, use a browser-driving architecture such as Puppeteer or Playwright. That approach renders a page in a real browser process, but it introduces browser installation, sandboxing, navigation timeouts, authentication, cookie, and resource-management concerns. It is the appropriate boundary when you need browser pixels rather than a best-effort DOM reconstruction.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
4 Pack LCD Writing Tablet for Kids, 8.5 Inch Colorful Doodle Board Drawing Tablet, Educational Learning Toys Birthday Gifts for Boys Girls Age 3 4 5 6 7 8
  • 4 Pack for More Fun: Apply the newest flexible liquid crystal technology, brighter and clearer than most LCD writing tablet. Take pressure-sensitive technology, you can draw lines of different thicknesses through different pressure levels. Package includes 4 pack lcd writing tablet (Blue, Light blue, Green and Pink), free children's imagination and creativity.
  • 8.5 Inch Colorful Lcd writing Tablet: TQU kids LCD doodle board is a creative education and learning toy, perfect support for drawing, writing, spelling, math, remark, and notes which can let your kids freely release their natural instincts. With erase button on the front and lock switch. You can draw and erase easily by pressing the button on the front of the board. The pen fits snug on top of tablet and it will not come loose.
  • Easy to use and Durable: The LCD writing tablet for kids is easy to use, just use the stylus to write, draw, scribble, doodle anything you want. Press the erase button to clear the screen in one second. Or press the lock key to save the screen contents. Our magic reusable drawing tablet is built in a button battery.
  • Safe & Portable Toddler Travel Toys: Great for quiet, take-along entertainment. It’s an easy way to color on the go without lugging a bunch of stuff in the car or to a restaurant or church.
  • Perfect Gift Idea: The multi-functional LCD writing tablet is a great gift choice for kids. It can be an educational toy for preschoolers. A perfect parent-pick gift for 3 4 5 6 7 8 year old girls and boys on back to school, homeschool, birthday, Easter, Children's Day, Thanksgiving Day, Christmas and any occasion.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server. One request can return PNG, JPEG, WebP, or PDF without maintaining Puppeteer or Playwright infrastructure. Before capture it accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status.

See the parameter reference in the ScreenshotNeo documentation. The same endpoint supports full-page lazy-image loading, CSS-selector element capture, dark mode, 12 device presets or custom viewports, retina scale, PDF paper sizes and page ranges, HTML/CSS rendering, custom JavaScript and CSS, pre-capture clicks, selector hiding, waits, request blocking, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification.

cURL

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}`);

The free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account to try the call.

Performance, reliability, and cost considerations

  • Memory: Bitmap memory grows with width × height × scale². A smaller scale or several sections can prevent browser memory exhaustion.
  • Network: Wait for images and fonts before capture, but verify that waiting did not create an oversized layout.
  • Repeatability: Fix viewport, device-pixel ratio, timezone, and content state when comparing outputs.
  • Security: Keep API keys server-side when calling a remote screenshot service; do not embed them in public browser code.
  • Billing: ScreenshotNeo reports whether a response was billed through its headers, and failed or unusable page results listed above are not charged.

FAQ

Can I make html2canvas capture an entire page by setting height: document.body.scrollHeight?

Only if the resulting bitmap remains within the browser’s dimension and area limits. Set matching window dimensions for the intended scroll capture, then verify the actual canvas size and split the page if necessary.

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

Does a successful promise prove that the screenshot is valid?

No. html2canvas can resolve with a blank or partial canvas when a platform limit or unsupported content is involved. Validate dimensions and inspect the image visually or by checking its exported byte data.

Best Value
Sale
XPPen Artist 13.3 Pro V2 Drawing Tablet with Screen, 16K, Full-Laminated
  • PLEASE NOTE:XPPen Artist13.3 Pro drawing tablet Need to connect with computer,you need to use it with your computer or laptop, the 3 in 1 cable is included
  • Drawing Tablet with Screen: Tilt Function- XPPen Artist 13.3 Pro supports up to 60 degrees of tilt function, so now you don't need to adjust the brush direction in the software again and again. Simply tilt to add shading to your creation and enjoy smoother and more natural transitions between lines and strokes
  • Graphics Tablets: High Color Gamut- The 13.3 inch fully-laminated FHD Display pairs a superb color accuracy of 88% NTSC (Adobe RGB≧91%,sRGB≧123%) with a 178-degree viewing angle and delivers rich colors, vivid images, and dazzling details in a wider view. Your creative world is now as powerful as it is colorful
  • Drawing Pad: One is enough- The sleek Red Dial on the display is expertly designed with creators in mind, its strategic placement allows for natural drawing postures. With just one wheel, you can effortlessly zoom in and out, adjust brush sizes, and flip the canvas—all tailored to suit the habits of everyday artists. The 8 customizable shortcut keys allow you to personalize your setup, streamlining your workflow and enhancing creative efficiency
  • Universal Compatibility & Software Support:supports Windows 7 (or later), Mac OS X 10.10 (or later), Chrome OS 88 (or later), and Linux systems. Fully compatible with major creative software including Photoshop, Illustrator, SAI, and Blender 3D. Register your device to access additional programs like ArtRage 5 and openCanvas for expanded creative possibilities.

Is a proxy required for every external image?

No. A remote image can work directly when its response permits CORS and you enable useCORS. A proxy is needed only when you cannot obtain suitable cross-origin headers from the image host.

Frequently Asked Questions

Can I make html2canvas capture an entire page by setting height: document.body.scrollHeight?

Only if the resulting bitmap remains within the browser’s dimension and area limits. Set matching window dimensions for the intended scroll capture, then verify the actual canvas size and split the page if necessary.

Does a successful promise prove that the screenshot is valid?

No. html2canvas can resolve with a blank or partial canvas when a platform limit or unsupported content is involved. Validate dimensions and inspect the image visually or by checking its exported byte data.

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

Is a proxy required for every external image?

No. A remote image can work directly when its response permits CORS and you enable useCORS. A proxy is needed only when you cannot obtain suitable cross-origin headers from the image host.

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 *

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

Read next

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.