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

If an html2canvas result is completely blank or cut off, check the canvas dimensions first: browsers can silently return partial or empty output when a canvas exceeds platform limits. Missing images, CSS differences, empty iframes, and calls made from Node.js have different causes, so identify what is absent before changing options. html2canvas reconstructs a page from DOM and CSS information; it is not a pixel-for-pixel screenshot of the browser.

Diagnose the symptom before changing settings

Use the shape of the failure to narrow the cause. A page that looks correct in the browser can still be incomplete in html2canvas because the library has to read and recreate page content under browser security and canvas rules.

What you see Likely cause First check
The whole canvas is blank or only part of it appears Canvas dimensions or browser/platform size limits Compare the target element’s scroll dimensions with the capture window dimensions.
Text appears but external images are missing Cross-origin image access, image loading, or a failed resource request Check the image response’s CORS headers and html2canvas resource diagnostics.
The layout or styling differs from the page A CSS property is unsupported or incompletely implemented Isolate the affected element or style and test a simpler case.
An embedded frame is empty The iframe is cross-origin or sandboxed without same-origin access Check the frame’s origin and sandbox attributes.
The call fails in a server-side script html2canvas expects a browser runtime Run it in a browser, or use a browser automation tool for server-side capture.

These symptoms can overlap. For example, a large page can also contain an external image that fails CORS. Diagnose the missing region or resource rather than treating every blank-looking result as the same error.

Fix a blank or cut-off canvas caused by size

The html2canvas FAQ explains that browsers may silently produce blank or partially rendered canvases when a canvas exceeds size limits, without throwing an error. The project’s FAQ describes the limit figures as approximate and platform-dependent, not guaranteed thresholds: it lists roughly 32,767 pixels as a maximum dimension for Chrome/Chromium, Firefox, and desktop Safari; approximate maximum areas of 268 megapixels for Chrome/Chromium and 472 megapixels for Firefox; and lower, RAM-dependent limits on iOS Safari. See the html2canvas FAQ for its current guidance.

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.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

For a long target element, set the capture window to its scroll dimensions so the renderer sees the intended width and height:

const element = document.querySelector("#report");

if (!element) {
  throw new Error("Capture target #report was not found");
}

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

document.body.appendChild(canvas);

Use a target selector that resolves to the content you actually intend to capture. If the element’s scroll dimensions are themselves very large, matching the window does not remove browser canvas limits. Try a smaller capture region or divide the content into sections. Reducing scale can be a useful experiment when testing memory or size pressure, but the FAQ does not promise that scale changes will fix a particular failure.

Check the dimensions you are asking for

  • Inspect element.scrollWidth and element.scrollHeight, not just the visible box size.
  • Check for unexpectedly large dimensions caused by off-screen content, wide tables, or long pages.
  • Test a smaller target. If it renders while the full target does not, size or resource pressure becomes more plausible.
  • Do not rely on a thrown exception as proof that the canvas is within limits; oversize output can fail silently.

Restore missing cross-origin images

By default, html2canvas avoids adding images that would taint the canvas because a tainted canvas cannot be read back as an image. Setting useCORS: true asks the browser to load images through CORS; it does not bypass the browser’s same-origin policy. The remote image server must return an appropriate Access-Control-Allow-Origin response header for your page’s origin, or a suitable proxy must fetch and serve the image. The project describes both CORS and proxy approaches in its proxy documentation and FAQ.

const canvas = await html2canvas(element, {
  useCORS: true,
  imageTimeout: 15000,
  logging: true,
});

This option can help only when the image host permits the cross-origin request. If you control that host, configure its CORS response for the page origin. If you do not control it, use a permitted proxy or accept that the browser may prevent the image from being rendered. Avoid using allowTaint: true as a supposed export fix: allowing a tainted canvas may make its contents unreadable by APIs such as toDataURL().

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.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Separate an image error from a screenshot error

  • Open the image URL directly and confirm it loads.
  • Check the browser developer tools’ Network and Console panels for failed requests, blocked requests, or CORS errors.
  • Use html2canvas’s logging, onError, and imageTimeout options to inspect resource failures and loading behavior. Their option definitions are in the configuration reference.
  • Confirm that the image is loaded before capture, especially if your application inserts it asynchronously.

Investigate styling that renders incorrectly

html2canvas traverses the DOM and recreates a representation from properties it reads; it does not copy the browser’s final composited pixels. The project notes that CSS properties must be implemented individually and that it cannot support every CSS property. Consequently, a page can look right in a browser while an unsupported or partly supported style is missing or different in the output. Review the project’s FAQ and documentation for the library’s rendering model and support limitations.

Reduce the issue to a small reproducible element: temporarily remove or simplify the suspected style, then compare the output. If the simplified version works, the cause is likely tied to a rendering feature rather than a blank canvas as a whole. The project recommends creating a test case when a property appears missing or incomplete.

Options such as onclone let you modify the cloned document before rendering without changing the live page. ignoreElements and the data-html2canvas-ignore attribute can exclude elements that interfere with a capture. They can help isolate or omit troublesome content, but they cannot make html2canvas implement an unsupported CSS property. See the options reference for the exact configuration behavior.

Check iframe origin and sandbox settings

html2canvas can render same-origin iframe contents recursively. It cannot read the contents of a cross-origin iframe because the browser makes its contentDocument inaccessible. A sandboxed frame without allow-same-origin is also inaccessible to the library. These are browser security boundaries, not options html2canvas can override. The project explains this limit in its documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

If the embedded content is under your control, consider whether it can be rendered on the same origin or captured separately from within its own permitted context. Do not try to defeat a frame’s origin or sandbox restrictions; a parent page cannot use html2canvas to read content the browser has withheld.

Run html2canvas in a browser, not plain Node.js

html2canvas depends on browser objects such as window, document, and computed styles. It is a client-side library, so calling it in a plain Node.js process does not provide the environment it needs. For a page that must be rendered server-side, the project FAQ points to headless browser tools such as Puppeteer or Playwright. In a browser extension, it recommends native extension screenshot APIs when appropriate; those APIs also avoid html2canvas’s canvas-size limitation for that use case. These alternatives change where capture happens, but do not grant access to protected cross-origin content. See the FAQ.

Use diagnostics to find the failing step

Before changing several settings at once, turn on logging and inspect the specific failed resource or rendering stage. The configuration reference includes logging, onError, and imageTimeout for diagnosing resource loading. The following browser-side example logs the target dimensions and reports a failed capture promise:

async function captureReport() {
  const element = document.querySelector("#report");
  if (!element) throw new Error("Missing #report element");

  console.log({
    scrollWidth: element.scrollWidth,
    scrollHeight: element.scrollHeight,
  });

  try {
    const canvas = await html2canvas(element, {
      windowWidth: element.scrollWidth,
      windowHeight: element.scrollHeight,
      useCORS: true,
      logging: true,
      imageTimeout: 15000,
      onError(error) {
        console.error("html2canvas resource error:", error);
      },
    });
    document.body.appendChild(canvas);
    return canvas;
  } catch (error) {
    console.error("html2canvas capture failed:", error);
    throw error;
  }
}

Use onError according to the installed version’s callback signature; the option reference is the authority for the version you are using. A failed image callback does not necessarily mean the renderer itself rejected the whole capture. Treat logs as diagnostic evidence, then match each error to the missing content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose a different capture method when the job calls for it

html2canvas is useful when you need a client-side rendering of a DOM element and can work within its reconstruction and browser-security limits. Choose a different method when the requirement is a server-side browser capture, a browser-extension tab capture, or an actual browser-rendered page image rather than a DOM reconstruction. The project FAQ names Puppeteer and Playwright for server-side browser-driven screenshots, and native extension screenshot APIs for extension use. The right choice depends on execution location, capture scope, and access permitted by browser security; none should be treated as a way around access controls.

Or skip the browser setup

For server-side website captures without setting up a headless browser, ScreenshotNeo offers a screenshot API and MCP server. It accepts one GET request for a URL and returns a PNG, JPEG, WebP, or PDF. Cookie banners are accepted and removed before capture, along with 60+ known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. AI agents can use its MCP tools: take_screenshot, get_page_info, and capture_pdf.

cURL example; replace the example URL with the page you are authorized to capture. Keep the key private. See the ScreenshotNeo API documentation for request options and response details.

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

ScreenshotNeo’s free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. This captures a website URL through ScreenshotNeo rather than rendering an element from your current page with html2canvas, so use it when that difference fits the task.

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

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Frequently Asked Questions

Does setting useCORS: true make every external image appear?

No. The image host must allow the cross-origin request with a suitable CORS response header, or you need a suitable proxy.

Can html2canvas capture a cross-origin iframe?

No. Browser origin restrictions prevent access to the frame’s contents; sandboxing without allow-same-origin also blocks access.

Will html2canvas support every CSS property if I use onclone?

No. onclone can modify the cloned document, but it does not add support for CSS properties the library has not implemented.

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

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.