The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →For a screenshot of an element in a web page you control, use html2canvas to render that element into a canvas, convert the canvas to a Blob, append it to FormData, and POST it with fetch. The browser workflow is convenient, but it reconstructs the page from DOM and CSS rather than capturing the browser’s pixels, so cross-origin assets, unsupported styling, and very large canvases can affect the result.
Capture an element and upload it
Install the package, select the element you want, then use the following browser-side function. It returns the successful HTTP response so your application can handle whatever response contract its upload endpoint defines.
npm install @html2canvas/html2canvas
import html2canvas from '@html2canvas/html2canvas';
function canvasToBlob(canvas, type = 'image/png', quality) {
return new Promise((resolve, reject) => {
try {
canvas.toBlob(blob => {
if (blob) {
resolve(blob);
} else {
reject(new Error('Canvas conversion failed'));
}
}, type, quality);
} catch (error) {
reject(error);
}
});
}
export async function captureAndUpload(element, endpoint) {
if (!element) throw new Error('Screenshot element was not found');
const canvas = await html2canvas(element, {
scale: window.devicePixelRatio,
useCORS: true
});
const blob = await canvasToBlob(canvas, 'image/png');
const formData = new FormData();
formData.append('screenshot', blob, 'screenshot.png');
const response = await fetch(endpoint, {
method: 'POST',
body: formData
});
if (!response.ok) throw new Error(`Upload failed: ${response.status}`);
return response;
}
const element = document.querySelector('#receipt');
const response = await captureAndUpload(element, '/upload');
Use a real endpoint in place of /upload; the browser code cannot determine your server’s route or response format. The multipart field name here is screenshot, and the filename is screenshot.png. Your server must expect that field name or you must change it to match your endpoint.
What each stage does
- DOM element to canvas:
html2canvas(element)returns a Promise that resolves to a canvas rendered from the selected element. - Canvas to Blob:
toBlob()encodes the canvas asynchronously as an image file-like object. PNG is the default if no supported image type is supplied; the example requests PNG explicitly. - Blob to multipart data:
FormDatapackages the Blob as a named upload field. - POST to the server:
fetchsends the form. Checkingresponse.okturns non-success HTTP statuses into an application-visible error.
Why send FormData without a Content-Type header
Do not set Content-Type: multipart/form-data yourself when passing FormData to fetch. The browser must add the multipart boundary parameter that separates the form fields and file data. A manually supplied header generally omits the matching boundary and can leave the server unable to parse the request. Let the browser generate the header.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problems#1 Best Overall
- 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
- 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
- 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
- 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
- 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0
The server is responsible for parsing multipart form data and deciding whether to authenticate the request, how large an upload to accept, which file types to permit, and where to store the result. Those policies depend on your application; the browser example does not provide server-side validation or storage.
Choose capture settings for the output you need
High-DPI output
The example sets scale to window.devicePixelRatio, which increases the canvas pixel dimensions for high-density displays. It can improve sharpness, but it also increases memory use and makes the image larger. For predictable, smaller output, choose a fixed scale such as 1 instead of using the device ratio.
Capture a region
Pass the specific DOM element to html2canvas when you need one card, receipt, chart, or other component rather than the whole page. For a manually defined rectangle, the library’s examples use x, y, width, and height options. Ensure the coordinates and dimensions describe the intended area in the rendered page.
Rank #2
- [Enhanced 4K-1080P Video Capture Experience] Capture the Magic: Elevate your video recordings to new heights with our upgraded anti-static 1080P Video Capture Card. Immerse yourself in stunning visuals, supporting HDMI input at 4K 60FPS and USB output for capturing in 1080P, complete with rich stereo sound. Enjoy crystal-clear video recordings, dynamic gaming live streams, and professional conference broadcasts. Note: HDMI resolution: Max input can be 3840×2160@30Hz / Video output resolution: Max output can be 1920×1080@30Hz
- [Seamless Real-Time Preview] Stay in the Moment: Our advanced ultra-low latency technology ensures seamless real-time transmission of video streams. Experience instant, lag-free previews, allowing you to capture every detail precisely. Effortlessly record video directly to your hard disk, all without compromising on quality or introducing any delays.
- [Versatility and Broad Compatibility] Your Creative Hub: Connect your DSLR, camcorder, or action camera to a wide range of operating systems, including Windows, MacOS, and Linux. Unlock a world of possibilities with real-time streaming to popular platforms like Twitch, Youtube, OBS, Zoom, Potplayer, and VLC, giving you the tools to share your content effortlessly.
- [Effortless Plug and Play] Simplicity Redefined: Say goodbye to complex installations. Our plug-and-play design eliminates the need for drivers or external power supplies. Seamlessly integrate high-definition acquisition into various scenarios, whether it's educational recordings, immersive gaming, precise medical imaging, captivating live streams, or professional broadcasting.
- [Seize Every Detail with Precision] Unleash your creativity and attention to detail with our video capture card. Capture every nuance, every color, and every moment with precision, thanks to the enhanced capabilities of our technology. Whether you're a content creator, a gamer, or a professional, our capture card empowers you to seize the finest elements and bring them to life in your recordings and live streams.
Capture a full page
For a full-page render, set windowWidth and windowHeight to the relevant element’s scroll dimensions, rather than assuming the visible viewport covers all content. Lazy-loaded images may still need to load before capture. Full-page renders can create very large canvases, so watch for browser dimension or area limits; reducing the scale or splitting the capture into smaller regions can avoid blank or partial output.
Choose an image format
toBlob() accepts an image MIME type and, for supported formats, a quality argument. PNG is a practical default when you need broad support or sharp text and interface details. If you request another type, verify that the browser produced the format you expect before naming the upload file with that extension. The filename in FormData does not itself convert the image.
Know what html2canvas can and cannot capture
html2canvas does not take a native screenshot of the browser window. It builds a visual representation from DOM information and CSS. As its documentation explains, the result may not be completely accurate to the real page rendering. CSS features outside its support and browser-rendered details may differ, so check the output against the specific page and styles you need to capture. html2canvas documentation
Rank #3
- 【4K HDMI Input, 2K@30Hz Recording】Powered by a true USB 3.0 high-speed interface, the capture card supports up to 4K@30Hz HDMI input and records at 2K@30Hz or 1080P@60Hz. Perfect for gamers, streamers, and professionals who need crisp, smooth video for live streaming, gameplay recording, or online meetings.
- 【Ultra Low Latency Screen Sharing】Built with a premium aluminum alloy shell and advanced chipset for stable heat dissipation, ensuring ultra-low latency transmission. Capture high-quality video and dual-channel audio in real time—no lag, no frame drop—ideal for Twitch, YouTube, or OBS streaming.
- 【Easy Plug and Play, Compact & Portable】No driver or external power required—just plug and play via USB 3.0 or Type-C connection to your Windows or macOS computer. Lightweight and compact design makes it easy to carry for outdoor streaming, live shows, or mobile recording setups.
- 【Wide Compatibility & Multi-Device Support】Compatible with Windows 7 8 10 11, macOS, Linux,Android and supports most popular software such as OBS, Zoom, VLC, Twitch Studio, and more. Works seamlessly with PS4, PS5, Xbox, Switch, DSLR cameras, TV boxes, and other HDMI-output devices for streaming to YouTube, Twitch, etc.
- 【What You Get】Includes: HDMI Capture Card, USB 3.0 to USB-C Adapter, User Manual. Tips: Make sure your tablet’s OTG function is enabled before connecting. Test your HDMI device with a monitor first to confirm video and audio output, then connect to the Video Capture Card for recording.
This approach runs in a browser context; html2canvas is not a Node.js server-side renderer. If the capture must happen on your server, use browser automation such as Puppeteer or Playwright to render the page in a real browser. If you are building an extension and need the browser’s visible tab rather than a DOM reconstruction, extension APIs such as chrome.tabs.captureVisibleTab() or browser.tabs.captureVisibleTab() are a different option with their own permissions and deployment model. html2canvas FAQ
Fix blank, incomplete, or failed captures
Images are missing or the canvas cannot be exported
A cross-origin image may taint the canvas unless the image server permits cross-origin use. Setting useCORS: true asks the library to load images with CORS, but it does not bypass the browser’s origin security rules: the image server must send a suitable Access-Control-Allow-Origin header. If you control neither the image host nor its CORS configuration, serve the asset through a same-origin proxy that you control, subject to the remote service’s terms.
Recommended Free Tools
A canvas that is not origin-clean can make toBlob() throw a SecurityError. The example rejects if conversion throws and also treats a null Blob as a conversion failure, so callers can handle both cases instead of attempting an upload with no image.
Rank #4
- 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
- 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
- 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
- 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
- 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.
Content inside a cross-origin iframe is absent
Browser same-origin protections prevent page scripts from reading a cross-origin iframe’s contentDocument. html2canvas cannot reconstruct content it cannot access. Capture content from the iframe’s own origin with code running there, obtain an authorized image from its owner, or use an approach that captures the rendered browser page where appropriate. html2canvas FAQ
The output is blank or cut off
Very large canvas dimensions or total pixel area can exceed browser limits and produce blank or partially rendered output. Reduce the target area, lower scale, or capture separate sections. For long pages, size the render using the content’s scroll dimensions and test the resulting dimensions before encoding.
The upload fails after capture succeeds
Inspect the browser’s Network panel and the HTTP status. Confirm the endpoint accepts POST, parses multipart data, and expects a field named screenshot. Check authentication, file-size limits, allowed media types, and server storage errors. Do not “fix” multipart parsing by setting the Content-Type header manually; let fetch include the boundary.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- AV TO USB Converter: Capture videos and audios from VHS, VCR, Hi8, DV tapes to a PC, with the help of our USB Video Converter. Save room while digitizing your favorite old memories
- Quality Capture Card: Our USB Video Capture Card converting anolog RCA composite input into HD 720P USB output and capturing audio without any sound card. Advanced signal processing technology provides you with great precision, colors, resolutions, and details.
- Plug and Play: Automatically install the driver once you hook up this RCA to USB Converter to a PC. No external power is needed. User-friendly and easy to operate
- Wide Compatibility: The Video Capture Card can work with video devices with RCA connector or S-Video connector, such as VHS, VCR, Hi8, camcorder, compatible with Windows and Mac OS. Support video formats like NTSC, PAL, and support brightness, contrast, hue, and saturation control
- Note: The Video Converter is used with acquisition software. We recommend OBS Studio or PotPlayer for Windows, and QuickTime Player for Mac. They can be downloaded for free online. Please operate according to the steps in User Manual or contact us if you have any questions
The screenshot looks different from the page
That is a capture-fidelity issue, not an upload failure. Since the library reconstructs DOM and CSS rather than copying rendered pixels, first check whether the relevant styles and content are supported and accessible. If exact browser rendering is central to the requirement, consider a real browser capture workflow instead of DOM reconstruction.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
For a URL-based screenshot or PDF, ScreenshotNeo offers a single GET request. Its browser capture service accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with the page verdict and billing status reported in response headers. ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. It is a different workflow from capturing an arbitrary live DOM element in the current browser tab.
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://stripe.com
-o shot.webp
Replace the example URL with the page you need and provide an API key. See the ScreenshotNeo API documentation for request options and response details. Plans include 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000 screenshots. Learn about ScreenshotNeo or sign up free.
Frequently Asked Questions
Can I capture an HTML element instead of the whole page?
Yes. Select the element and pass it to html2canvas(element); the example above uploads that element’s rendered canvas.
Why is my uploaded screenshot blank even though fetch succeeded?
The capture may have produced a blank canvas before the upload. Oversized dimensions and inaccessible cross-origin content are common causes; check the canvas output and browser console before investigating the endpoint.
Can html2canvas take a screenshot in Node.js?
Not as a server-side renderer: it depends on browser APIs. Use browser automation such as Puppeteer or Playwright when the capture must be performed server-side.
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.




