html2canvas not working for mobile browser for iPhones (iOS)

231 Views Asked by At

We are creating an embeddable widget using HTML2canvas library. It works fine for desktop browsers and android mobile browsers. But in iOS the widget does not capture the full screen but only captures certain parts of the screen.

This happens with Chrome on iOS on iPhones. Any help will be much appreciated.

Thanks

We are not having any ideas as of now. The below url is exact representation where i'm facing issue, i'm using html2canvas version 1.4.1. In below url you can click on button having keyword "Snap" (it is located at left middle of screen) it will download a image using html2canvas

https://feedback.scavenzer.com/sample.html

The table under class "surveyListingContainerDesign" doesn't get captured in ios device.

Sample code for your reference

var options = {width: window.innerWidth, height: window.innerHeight};
html2canvas(document.body, options).then(function (canvas) {
    var dataUrl = canvas.toDataURL("image/png"); 
    var a = document.createElement('a'); 
    a.href = dataUrl; 
    a.download = 'filename.png'; 
    document.body.appendChild(a); 
    a.click(); 
});

You can find similar code in above url html (find using "TakeSnap" keyword)

0

There are 0 best solutions below