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

If an inline SVG is complete in the browser but cropped, shifted, or partly missing in an html2canvas image, treat it as a bounds-and-serialization investigation rather than assuming a single bug. Record the exact environment, reduce the page to one positioned SVG, inspect computed geometry and clipping, then compare that geometry with the capture rectangle. GitHub issue #3047 describes this exact pattern with html2canvas 1.4.1, Chrome 111, and Windows 10, but it is a user report—not a maintainer-confirmed root cause or universal diagnosis.

What the reported failure actually says

Issue #3047 was opened on April 7, 2023. The reporter wrote: “When rendering svg, if position: absolute; is used on the svg element, and it is not located in the upper left corner of the parent container (left: 0; top: 0;), when it is converted into an image through SVGElementContainer, it will generate Incomplete rendering.” Their environment was html2canvas 1.4.1, Chrome 111, and Windows 10.

The same report proposes that XMLSerializer incorporates computed positioning attributes into the serialized SVG. That is the reporter’s hypothesis; available project material does not confirm it as the implementation’s root cause. Keep that distinction when documenting a production incident.

A separate, older issue (#2398) described offset or incomplete SVG output associated with scrolling, using html2canvas 1.0.0-rc.7 and Chrome 86 on Windows 10. Its age, versions, and circumstances differ, so it should be treated as another possible symptom pattern, not evidence that both reports share one fix.

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
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

Why html2canvas can differ from the browser

html2canvas reconstructs a canvas image from the DOM and selected CSS properties; it does not ask the browser for a universally pixel-perfect screenshot. The project FAQ explicitly says: “Every CSS property must be manually implemented to render correctly, so html2canvas will never have full CSS support.” An absolutely positioned SVG therefore passes through several coordinate systems: the positioned parent, the SVG element’s border box, its viewBox, any ancestor clipping, and html2canvas’s requested capture rectangle.

When the regular renderer encounters an inline SVG, its internal SVG container handling serializes content before drawing it. A mismatch between serialized coordinates and the capture bounds can appear as a crop or shift even though normal browser painting looks correct. That explanation is plausible for the reported case, but it is not established as a general mechanism.

Reproduce the smallest possible case

  1. Record the setup. Write down the html2canvas version, browser and version, operating system, whether the SVG is inline or loaded through an <img>, the element passed to html2canvas(), every non-default option, device-pixel ratio, and scroll position.
  2. Create one positioned parent. Remove frameworks, transitions, filters, masks, external fonts, and unrelated siblings. Keep a fixed-size parent with position: relative and one inline SVG child.
  3. Capture two positions. First use left:0; top:0; then apply the real offset that fails. The first result is a control, not a guaranteed workaround.
  4. Compare screenshots and geometry. Save the browser rendering and canvas output at the same scale. Note whether the SVG is clipped, translated, blank, or only missing content outside the parent.
<div id="stage" style="position:relative;width:420px;height:240px;overflow:hidden;background:#eee">
  <svg id="art" width="180" height="120" viewBox="0 0 180 120"
       style="position:absolute;left:120px;top:50px;background:white">
    <rect width="180" height="120" fill="#1463ff"/>
    <circle cx="90" cy="60" r="42" fill="#ffd166"/>
  </svg>
</div>
<script>
  html2canvas(document.querySelector('#stage'), {scale: 1}).then(c =>
    document.body.appendChild(c));
</script>

Inspect bounds, positioning, and clipping

Run this in DevTools with the failing page. It reports the values that determine whether the SVG can fit inside the requested capture.

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
const svg = document.querySelector('#art');
const parent = svg.parentElement;
const sr = getComputedStyle(svg);
const pr = getComputedStyle(parent);
console.table({
  svgRect: svg.getBoundingClientRect().toJSON(),
  parentRect: parent.getBoundingClientRect().toJSON(),
  position: sr.position,
  left: sr.left,
  top: sr.top,
  width: sr.width,
  height: sr.height,
  viewBox: svg.getAttribute('viewBox'),
  overflow: sr.overflow,
  parentPosition: pr.position,
  parentOverflow: pr.overflow,
  scrollX: window.scrollX,
  scrollY: window.scrollY,
  devicePixelRatio: window.devicePixelRatio
});

Check the containing block

An absolutely positioned SVG is placed relative to its nearest positioned ancestor. Confirm that the intended ancestor—not an unexpected wrapper, transformed element, or scroller—has position:relative, absolute, fixed, or sticky. A transformed ancestor can establish another coordinate system and make apparently correct offsets hard to compare with canvas coordinates.

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

Check intrinsic dimensions and the viewBox

Verify the SVG’s width, height, and viewBox. A viewBox that excludes painted content, or CSS dimensions that differ from intrinsic dimensions, can look like html2canvas cropping. Inspect the actual element rectangle rather than relying on attributes alone.

Check overflow and ancestor clipping

Walk up the ancestor chain and record overflow, clip-path, masks, transforms, and scroll containers. SVG 2 describes a foreignObject rectangle as a containing block and explains that overflow controls whether content extending outside that rectangle is hidden. This standard is useful for analyzing bounds, but it does not prove the mechanism of issue #3047.

Align the html2canvas capture rectangle

For element captures, html2canvas normally derives a region from the target’s bounds. Explicit options can change that region:

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.
html2canvas(target, {
  x: 0,
  y: 0,
  width: target.getBoundingClientRect().width,
  height: target.getBoundingClientRect().height,
  scrollX: window.scrollX,
  scrollY: window.scrollY,
  scale: window.devicePixelRatio
});

Use values in CSS pixels for x, y, width, and height; scale controls output resolution. Compare the requested rectangle with getBoundingClientRect(). If the target is captured while the page is scrolled, test both explicit and default scroll values. The older offset report makes scrolling a worthwhile diagnostic, not a confirmed explanation for the newer report.

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

Regular rendering versus foreignObjectRendering

html2canvas has two materially different paths. The normal path reconstructs supported DOM and CSS. The experimental foreignObjectRendering path builds an SVG wrapper containing a foreignObject, serializes it, loads that serialized image, and draws it to canvas.

Diagnostic axis Regular renderer foreignObjectRendering
Mechanism html2canvas DOM/CSS reconstruction Serialized SVG foreignObject loaded as an image
CSS fidelity Limited to implemented properties Delegates more layout to the browser engine, but remains experimental
SVG bounds Inspect element and reconstructed container bounds Inspect the wrapper rectangle and overflow as well as the SVG
Browser behavior Generally follows html2canvas’s supported path Can vary with browser security and foreignObject support
Issue #3047 status Reported failure path No source establishes this as a fix; test it in target browsers

Evaluate the alternate path as an experiment:

html2canvas(document.querySelector('#stage'), {
  foreignObjectRendering: true,
  useCORS: true
});

Do not ship it solely because it changes the output in one browser. Compare fonts, filters, external resources, clipping, and pixel alignment across every browser you support.

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

Work through common failure modes

The SVG is cropped on one side

  • Compare the SVG rectangle with the parent’s rectangle and the explicit x/y/width/height.
  • Temporarily set ancestor overflow:visible to identify clipping; restore the intended value after testing.
  • Check whether painted content extends beyond the viewBox.

The SVG shifts when the page scrolls

  • Log scrollX, scrollY, and the element rectangle immediately before capture.
  • Test a fixed capture region with matching scroll options.
  • Repeat on the current html2canvas release; the historical report used 1.0.0-rc.7.

The result is blank or partially missing

  • Confirm the SVG is inline, or test resource-loading and CORS behavior for referenced images, fonts, and stylesheets.
  • Remove filters, masks, and external resources from the minimal reproduction, then add them back one at a time.
  • Check browser console errors and whether the target is hidden, detached, or covered by a zero-size ancestor.

foreignObjectRendering differs by browser

  • Keep it behind a feature test and compare all supported browsers.
  • Test the exact production fonts and resources; an experimental path is not a compatibility guarantee.

When to report a bug

If the reduced example still fails on the current version, prepare a reproducible issue. Include the minimal HTML, CSS, SVG markup, browser and operating-system versions, html2canvas version, capture options, viewport and device-pixel ratio, a browser screenshot, the generated canvas, and the smallest change that triggers the failure. State whether the SVG is inline or referenced, whether scrolling is involved, and whether foreignObjectRendering changes the result. The project FAQ asks for a test case when a CSS property is missing or incomplete.

Check the live issue and release history before claiming that #3047 is fixed, closed, or still current. The available evidence does not establish its present disposition.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

For a server-side screenshot rather than a client-side html2canvas canvas, ScreenshotNeo accepts one GET request and returns PNG, JPEG, WebP, or PDF. It removes cookie-consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with the result identified by response headers. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. Every plan includes the features, and 1,000 screenshots per month are free with no card; paid plans start at $5 for 3,000 shots.

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

See the parameter reference and options in the ScreenshotNeo documentation, then create a free account to use the monthly 1,000-shot allowance.

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.

Frequently Asked Questions

Does setting left:0; top:0 permanently fix the SVG problem?

No. It is a useful control in a minimal reproduction. It does not establish why the offset case fails or prove that production layouts must use that position.

Is issue #3047 confirmed fixed in the latest html2canvas release?

The available evidence does not establish its current status. Check the live issue and release notes for the version you intend to deploy.

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.

Should every SVG export use foreignObjectRendering?

No. It is experimental and may behave differently across browsers. Compare both paths with your actual SVG, resources, and supported browser matrix.

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.