I’m attempting to save lots of a div regionally with the HTML2Canvas dependency. All the pieces appears to be working excellent on desktop and Android telephones, however on an iPhone there may be am dealing with the next downside:
When attempting to save lots of the generated canvas with the next code, the browser freezes:
html2canvas(doc.getElementById("theID"), {
scale: 5,
allowTaint: true,
imageTimeout: 15000,
logging: true,
useCORS: true,
}).then(operate (canvas) {
if (saveLocally) {
console.log("Begin saving regionally: ");
console.log(canvas);
canvas.toBlob(operate (blob) {
console.log(blob);
var imgsrc = canvas.toDataURL("picture/png");
});
console.log("completed creating screenshot");
window.location.href = "https://instance.com/cart";
}
});
The next output is written within the console:
DEBUG#1 0ms Beginning doc clone with measurement 414x720 scrolled to 0,-170
WARNING#1 1054ms Unable to revive scroll place for cloned doc
DEBUG#1 1057ms Doc cloned, aspect positioned at 76.15625,81.34375 with measurement 1066.4046630859375x1508.0211181640625 utilizing computed rendering
DEBUG#1 1057ms Beginning DOM parsing
DEBUG#1 1088ms Added picture knowledge:picture/svg+xml;charset=utf-8,%3Csvg xmlns="http://www.w3.org/2000/svg" xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule="evenodd" viewBox='0 0 88 23'%3Epercent3Cdefspercent3Epercent3Cpath id='emblem' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.2
DEBUG#1 1088ms Beginning renderer for aspect at 76.15625,81.34375 with measurement 1067x1509
DEBUG#1 1089ms Canvas renderer initialized (1067x1509) with scale 5
DEBUG#1 1130ms Completed rendering
LOGStart saving regionally:
LOG[object HTMLCanvasElement]
I’ve discovered some info on the web that the utmost measurement of a canvas on Ios is sort of small, so perhaps that could possibly be the difficulty. However what’s the answer on this? Is it potential to manually improve the utmost measurement for instance?
I would like my photographs to have the very best quality (most of them are round 12MB).
Additionally attempting to save lots of the blob with saveAs(blob, 'customImage.png');
from the FileSaver library does freeze the window.