Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsIf SVG lettering appears twice in an html2canvas screenshot, first check whether text inside an SVG <text> element is being processed both as an ordinary text node and by SVG rendering. That is a documented historical failure mode, not proof that every current html2canvas version has the same bug. Record your installed version, reproduce with a minimal SVG, and test the cloned DOM before applying any old parser patch.
Why SVG text can appear doubled
SVG text is represented in the DOM by an SVG <text> element and its child text node. A historical html2canvas issue reported that the characters were processed once as a text node and again as SVG content, making the rendered lettering look doubled or overlapped. The report concerned html2canvas 0.5.0-alpha2 and an SVG example with a transformed text element. The reporter described the issue as: “Text tag be processed as a Text node and also SVG”. This is a 2015 report, not evidence that current releases necessarily reproduce it.
A separate report from July 2015 said duplication seemed related to container size. It did not establish dimensions as the root cause. Treat width and height as variables to test in your own reproduction, not as a general explanation or fix.
Confirm that your case is the same failure
Record the exact environment
Before changing code, capture the html2canvas version from your lockfile or package manager, the browser and version, and the smallest HTML/SVG snippet that still produces the duplicate. Historical bug reports used old alpha releases, so the installed version matters. Also note whether the visible page itself looks correct and duplication appears only in the canvas output.
#1 Best Overall
Reduce the SVG carefully
Start with one <svg> and one <text> element. Remove unrelated labels, nested groups, CSS, and transforms one at a time. If the simplified example stops duplicating, restore each removed feature individually. This helps distinguish double processing from a particular transformation or surrounding layout interaction.
<div id="capture">
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="80">
<text x="10" y="50">SVG label</text>
</svg>
</div>
<canvas id="result"></canvas>
<script>
html2canvas(document.querySelector('#capture')).then(canvas => {
document.querySelector('#result').replaceWith(canvas);
});
</script>
This is a minimal reproduction pattern, not a guaranteed trigger. Include the same html2canvas script or module import you use in your application when testing, so the result reflects your installed version.
Check the DOM relationship
Inspect the SVG in browser developer tools. Confirm the lettering is in a <text> element and check whether the affected characters appear to be picked up again during a separate text-node traversal. The historical issue linked that type of double handling to overlap; the available evidence does not establish a universal way to inspect or patch every current implementation.
Isolate the cause one variable at a time
- Test the untransformed text. Remove SVG transforms, then add them back individually if the duplication disappears. The historical example included a transformed text element, but that does not show that transforms alone caused the failure.
- Vary the container dimensions. Change the outer element and SVG dimensions independently. Keep this as a reproduction test: one old report suggested a size relationship but did not prove dimensions were the cause.
- Compare browser results. Run the same small reproduction in the browsers you support. html2canvas lists Chrome/Chromium-based browsers, Firefox, and Safari among modern evergreen browsers, but that general support statement does not show this particular issue occurs in all of them.
- Separate unrelated rendering symptoms. Cross-origin image restrictions can prevent images from appearing, and browser canvas dimension limits can cause cutoffs. Those documented canvas concerns are not established causes of doubled SVG text.
Use onclone for a safe diagnostic test
html2canvas documents an onclone callback that lets you modify the cloned document before rendering. You can use it to test whether the affected SVG text is involved without changing the live page. The callback is a diagnostic tool here, not an officially documented fix for duplicate SVG text.
html2canvas(document.querySelector('#capture'), {
onclone: clonedDocument => {
const text = clonedDocument.querySelector('#capture svg text');
if (text) {
text.style.visibility = 'hidden';
}
}
}).then(canvas => {
document.body.appendChild(canvas);
});
If hiding the text only in the clone removes the duplicate, that is evidence that the SVG text is part of the reproduction. It does not identify exactly which parser step drew it twice. Once the test is complete, remove the diagnostic modification; otherwise the captured output will intentionally omit the label.
The configuration documentation also describes data-html2canvas-ignore for excluding elements, and options such as scale, width, height, and rendering-window dimensions. These can affect what is captured or its output dimensions, but the documentation does not present them as fixes for doubled SVG text.
Rank #3
When to consider a parser change or upgrade
A Stack Overflow answer from August 2015 described changing NodeParser.prototype.getChildren so text nodes beneath SVG parents would not also become ordinary TextContainer objects. The historical repository issue also included a quick check that the text node was not parented by an SVG <text> element. These are clues about the old failure mode, not ready-to-paste patches for a current package.
- Check the implementation in the exact version you have installed before considering a change.
- Do not assume an old prototype override still exists or has the same behavior in a modern release.
- Prefer a narrowly scoped, version-controlled change and rerun the minimal reproduction and your browser test set.
- Check the project’s current release notes or issue tracker for version-specific guidance before upgrading; the historical reports alone do not establish which release, if any, contains a fix.
If the issue appears only in a particular installed version, compare that version’s parser behavior with the historical parent-SVG checks. Avoid applying a broad DOM traversal change unless you have verified it fixes your reproduction without changing other text rendering.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Troubleshooting common outcomes
| Symptom | What to check | Next step |
|---|---|---|
| The page looks right, but the captured canvas has overlapping letters. | Whether text inside SVG <text> is also encountered as an ordinary text node. |
Use the minimal reproduction and cloned-document test to isolate SVG text handling. |
| Only the full page or one layout size duplicates the text. | Outer container size, SVG size, and layout changes, one at a time. | Record the dimensions that reproduce it. A historical report suggested a size relationship but did not prove it caused the bug. |
Text disappears after testing onclone. |
Whether the callback deliberately hid or altered the text in the cloned document. | Remove the diagnostic modification for normal captures; the callback test is not a production fix by itself. |
| Images are missing or the canvas is cut off as well. | Cross-origin content restrictions or browser canvas dimension limits. | Investigate those as separate canvas issues; the cited documentation does not connect them to duplicate SVG lettering. |
| An old patch does not apply. | The installed version’s parser structure and available methods. | Do not force a historical override into a different implementation. Verify current compatibility before adapting it. |
| The problem occurs in only one browser. | Browser and version, html2canvas version, and the same reproduction in each browser. | Keep the browser-specific result with the reproduction; broad browser support does not guarantee identical behavior for this defect. |
Performance, reliability, and choosing a remedy
For this issue, the useful measure is reproducibility, not a generic rendering-speed claim. Begin with the smallest failing example because it reduces unrelated layout and asset variables. Test dimensions and browser differences only after that baseline is recorded. The evidence here provides no prevalence statistic or current version-by-version browser matrix, so there is no sound basis for saying how often the problem occurs or promising that one setting fixes it.
Choose the least invasive remedy supported by your reproduction: a clone-only diagnostic change for investigation; a verified version upgrade if current project information identifies a relevant fix; or a narrowly scoped parser change only after confirming the installed implementation duplicates the SVG text traversal. Recheck the actual application SVG and supported browsers before shipping a workaround.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If what you need is an image or PDF of a public page rather than an html2canvas-specific canvas in your application, ScreenshotNeo is a website screenshot API and MCP server. It does not repair an html2canvas parser defect or provide the same in-page canvas workflow; it gives you a screenshot or PDF of a URL through an API request.
One-call cURL example:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for parameters and response details. Python:
Recommended Free Tools
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}`);
- Cookie and consent banners are accepted like a visitor, and 60+ known consent platforms, newsletter popups, and chat widgets are removed before the shot; each step can be turned off.
- Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers identify the page verdict and billing status.
- An MCP server exposes
take_screenshot,get_page_info, andcapture_pdfto Claude, Cursor, and other MCP clients. - The Free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots. Every feature is available on every plan.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Frequently Asked Questions
Does changing html2canvas scale fix doubled SVG text?
The documentation describes scale as an output setting, not as a fix for duplicate SVG text processing.
Is doubled SVG text a confirmed bug in every current browser?
No. The cited reports are historical, and they do not establish a current browser-by-browser reproduction pattern.
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.
Free tools Windows power users keep installed
One-click scans. No signup required.

