Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchSet html2canvas’s scale to window.devicePixelRatio for sharp output that matches the user’s display, or provide an explicit value when you need predictable pixel dimensions. A larger scale increases the canvas resolution—not the accuracy of unsupported CSS, cross-origin content, or browser-only effects—so choose it alongside the element’s size, memory limits and export format.
What the scale option actually changes
html2canvas does not capture the browser’s final framebuffer. It walks the DOM, reads styles and assets that the browser makes available, and reconstructs the result on a canvas. The scale option multiplies the canvas’s backing-store dimensions while the element keeps the same CSS size.
For example, a 900 × 600 CSS-pixel element rendered at scale: 2 produces a canvas of about 1,800 × 1,200 device pixels. Text and edges have more samples and normally look sharper when the PNG is viewed at its intended physical size. The output file can also become substantially larger.
The documented default is window.devicePixelRatio. On a 2× Retina display, the default therefore behaves like scale: 2; on a standard 1× display it behaves like scale: 1. You can pass that value explicitly or choose another value for a controlled export.
#1 Best Overall
- 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
Choosing a scale
| Goal | Typical setting | Trade-off |
|---|---|---|
| Match the current screen | window.devicePixelRatio |
Sharp on high-DPI screens, but output dimensions vary by device. |
| Predictable dimensions | An explicit value such as 1, 2 or 3 |
Consistent output, with more memory and processing at higher values. |
| Small web thumbnail | 1 or a deliberately reduced export |
Faster and smaller, but less detail when enlarged. |
| Print-oriented raster | Use the largest tested value that fits your target dimensions | Canvas limits and memory can cause blank or partial captures. |
There is no universally safe multiplier. A scale of 4 can be reasonable for a small card and impossible for a long page. Calculate the resulting width, height and total pixels before increasing it.
Basic high-quality capture
Load html2canvas in your page using the installation method appropriate for your project, then capture the element after its fonts, images and dynamic content are ready:
async function downloadCapture() {
const element = document.querySelector('#invoice');
if (!element) throw new Error('Capture element not found');
const canvas = await html2canvas(element, {
scale: window.devicePixelRatio,
});
const link = document.createElement('a');
link.download = 'invoice.png';
link.href = canvas.toDataURL('image/png');
link.click();
}
document.querySelector('#download').addEventListener('click', downloadCapture);
This follows the project’s high-DPI example: select a particular element, render it, convert the returned canvas to PNG and trigger a download. Use await so export begins only after rendering finishes.
Use an explicit scale when dimensions must be stable
const element = document.querySelector('#report');
const scale = 2;
const canvas = await html2canvas(element, { scale });
console.log({
cssWidth: element.getBoundingClientRect().width,
cssHeight: element.getBoundingClientRect().height,
pixelsWide: canvas.width,
pixelsHigh: canvas.height,
});
const png = canvas.toDataURL('image/png');
The canvas dimensions are approximately the CSS dimensions multiplied by scale, subject to rounding and the element’s layout. If your downstream service expects a fixed width, set the element’s CSS layout deliberately and keep the scale constant rather than guessing from the user’s monitor.
Recommended Free Tools
Rank #2
- 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
Capture a full or tall element safely
Viewport size and element size are different. For a long report, use the element’s scroll dimensions for the rendering window, as recommended in the html2canvas FAQ:
const element = document.querySelector('#long-report');
const canvas = await html2canvas(element, {
scale: window.devicePixelRatio,
windowWidth: element.scrollWidth,
windowHeight: element.scrollHeight,
});
Before capture, make sure lazy content has loaded and that the element is not clipped by an ancestor with an unintended overflow rule. Very tall output can exceed a browser’s maximum canvas dimension or total area. A failed limit may appear as a blank, truncated or partially rendered image, and raising scale makes the problem more likely.
Approximate browser limits
The html2canvas FAQ lists rough, browser- and platform-dependent guidance rather than guarantees: Chromium-based browsers are shown at approximately 32,767 pixels per dimension and 268 megapixels of area; Firefox at approximately 32,767 pixels and 472 megapixels; desktop Safari at approximately 32,767 pixels. iOS Safari is lower and depends on device RAM. Treat these as approximate current examples, test every target browser, and leave headroom for other canvases and page memory.
If a single canvas is too large, reduce the scale, capture sections separately and stitch them in a workflow designed for tiling, or provide a download at a smaller raster size. Do not promise that a higher scale can bypass a browser limit.
Rank #3
- 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.
Make the source renderable before scaling
Wait for images and fonts
Call html2canvas after the content is visible. For images you control, wait for their load events; for web fonts, wait for document.fonts.ready where supported:
await document.fonts?.ready;
await Promise.all(
[...document.images].map(img => img.complete
? Promise.resolve()
: new Promise(resolve => {
img.addEventListener('load', resolve, { once: true });
img.addEventListener('error', resolve, { once: true });
}))
);
const canvas = await html2canvas(document.querySelector('#app'), {
scale: window.devicePixelRatio,
});
This prevents a fast capture from recording fallback fonts or empty image boxes. It does not make an inaccessible resource accessible.
Handle cross-origin images
Images hosted on another origin must grant permission with an appropriate Access-Control-Allow-Origin response header. Set useCORS: true when the server is configured for it:
const canvas = await html2canvas(element, {
scale: window.devicePixelRatio,
useCORS: true,
});
useCORS defaults to false. If the image server does not send the required CORS header, use a same-origin proxy where that is permitted and secure. Increasing scale cannot bypass the browser’s same-origin protections. Cross-origin iframes are likewise blocked by browser security restrictions.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #4
- 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
Understand CSS coverage
Because html2canvas reconstructs the page from DOM information and supported CSS properties, the result can differ from what the browser displays. Unsupported filters, effects, pseudo-element details or other styling may be absent. A higher scale only gives more pixels to the reconstruction; it cannot add support for a property or turn it into a literal browser screenshot.
Export format and quality controls
PNG is the safest default for text, UI, transparency and line art:
const pngUrl = canvas.toDataURL('image/png');
For photographic content where a smaller file matters, JPEG can reduce size at the cost of transparency and lossless text edges:
const jpegUrl = canvas.toDataURL('image/jpeg', 0.9);
The quality argument applies to formats that support it. Check the resulting pixel dimensions and file size instead of assuming that a larger scale always looks better after a platform recompresses the image.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Best Value
- 【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.
Common failures and fixes
Text is blurry despite a high scale
- Confirm the actual
canvas.widthandcanvas.height; CSS display size can hide a high-resolution backing store. - Capture after web fonts load, and avoid immediately resizing the canvas with CSS and then treating that display size as its native resolution.
- Check whether the destination viewer is downsampling or recompressing the file.
Remote images are missing or the canvas is tainted
- Inspect the image response for
Access-Control-Allow-Origin. - Use
useCORS: trueonly when the server grants permission. - Otherwise serve the asset through a suitable same-origin proxy, or omit it. Scale does not solve CORS.
The result is blank or cut off
- Reduce the scale and test the capture’s calculated pixel area.
- For a tall element, set
windowWidthandwindowHeightfrom its scroll dimensions. - Capture a smaller region to identify the browser canvas limit or a problematic child.
- Check that the element is attached, visible and populated when the call runs.
Styles do not match the page
- Compare the missing style with html2canvas’s supported CSS properties; unsupported properties cannot be repaired with scale.
- Replace fragile visual effects with supported markup or CSS for the capture view.
- Remember that cross-origin iframes cannot be rendered by this library.
The call works locally but not on a server
html2canvas uses browser APIs and is client-side only. It is not a server-side renderer. For server-side screenshots, the project’s FAQ points developers toward Puppeteer or Playwright, which run a browser in an appropriate environment.
Performance and reliability checklist
- Estimate
CSS width × scaleandCSS height × scalebefore rendering. - Use the device-pixel-ratio default for display-oriented downloads; use an explicit scale for reproducible assets.
- Wait for fonts, images and application data, but avoid indefinite waits for failed resources.
- Capture only the needed element instead of the entire document when possible.
- Test the smallest and largest target browsers, especially iOS Safari and long pages.
- Keep a fallback for unsupported CSS, inaccessible images and oversized canvases.
- For browser extensions, the html2canvas FAQ recommends native screenshot APIs as more reliable and not subject to canvas-size limits.
Or skip the browser setup
If you need a rendered page rather than a DOM reconstruction, ScreenshotNeo returns a PNG, JPEG, WebP or PDF from one request. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the page verdict and billing status with X-Page-Verdict and X-Billed headers.
Use the API documentation at https://screenshotneo.com/docs/ for all options. A minimal request is:
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}`);
ScreenshotNeo also supports full-page lazy-image loading, CSS-selector element capture, dark mode, device presets or custom viewports, retina scale, custom CSS and JavaScript, clicks, selector or network-idle waits, request blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, chosen-TTL caching, signed image links, asynchronous webhooks, PDF controls, HTML/CSS-to-image, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. Its MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.
The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is included on every plan, and yearly billing gives two months free. Create a free ScreenshotNeo account to try it without a card.
When html2canvas is the right choice
Choose html2canvas when the capture should happen inside the user’s browser, the source is a same-origin DOM region you can prepare, and you need a client-side download without sending page content to a service. Choose a browser automation or screenshot API when you need server-side jobs, the browser’s actual rendering behavior, cross-origin or iframe-heavy pages, or dependable full-page capture beyond canvas limits. In either case, treat scale as a resolution control—not a repair for rendering or security constraints.
Frequently Asked Questions
Does scale: 2 mean the image will be twice as wide on screen?
No. It normally doubles the canvas’s pixel dimensions while the element’s CSS display size remains the same. A viewer can display those extra pixels at the original physical size.
Can html2canvas capture a page on the server without a browser?
No. It depends on browser APIs and is client-side. Use a browser-based server tool such as Puppeteer or Playwright, or a screenshot API, for server-side generation.
Free tools Windows power users keep installed
One-click scans. No signup required.
Quick Recap
Why does a screenshot include a cookie banner?
html2canvas captures the DOM that exists when it runs. Hide or remove the banner in your page before capture; the library does not automatically accept consent or clean overlays.
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.




