I am using the html2canvas in my project and getting the following issue:
I'm trying to capture a div as an image and create a file type containing that image URL. But the result is always showing 2680ms html2canvas: Unable to load image undefined after calling the **takeScreenShot function and not showing the image URL on button click. Any help regarding the issue?
Here's the portion of the code I am using for canvas in my react app:
takeScreenShot(e) {
e.preventDefault();
let imageView = document.querySelector(".image_view_101");
html2canvas(imageView).then(canvas => {
console.log(canvas);
let imgData = canvas.toDataURL("image/png");
console.log("canvas", imgData);
});
}
