question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

html2canvas is not working in Ipad/iPhone iOS 11.2.1 and iPhone X Safari borwser

See original GitHub issue

Hi,

I have use html2canvas function for capturing screen shot from div its working fine on web but its not working in Ipad iOS 11.2.1 Safari browser getting blank response. I have using Ipadair2 with iOS 11.2.1 and iPhone X

Include JS Version: jQuery v1.7.1 jquery.com html2canvas v1.0.0-alpha.7

Here the HTML code:

<div id="pdfContent" class="pdfContent" style="transform-origin: left top 0px; transform: scale(1);" crossOrigin="Anonymous">
        <img id="hotspotimg" src="img.jpg" cropwidth="1000" cropheight="600"/>
        <div id="editor"></div>
</div>

Here the JS code:

html2canvas(document.querySelector('#pdfContent'), {useCORS: true}).then(function (canvas) {
		    try {
		        var imgageData = canvas.toDataURL("image/png");
                          } catch (err) {
		      console.log(err)
		      alert(err)
		    }
        }).catch(function onRejected(error) {
        	alert(error);
}); 

I have tried multiple github solution like and other links but not working on Ipad/iPhone

Please help me:

Contact us: wagh.chetan@fxbytes.com

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
mjbernardo-30commented, Mar 30, 2020

i’m having the same issue, it works fine on any desktop browser and android devices, but not in safari. I’m using cropper.js to crop an uploaded image and preview to another image template. When i use safari it draw nothing.

0reactions
ayohdevcommented, Aug 22, 2020

@JacobJohnJ … I ended up having to create a separate HTML Element and absolute position it off screen to work. I styled each element on the canvas seperately to match what I wanted the download to be. It was very annoying but I was able to get the downloads to work this way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

html2canvas is not working in Ipad/iPhone iOS 11.2.1 Safari ...
I have use html2canvas function for capturing screen shot from div its working fine on web but its not working in Ipad iOS...
Read more >
Incompatibility problem - html2Canvas in ios 15
html2canvas library is used in our js project however it leads to white screen ... Have same issue. happens only when the html...
Read more >
[Solved]-html2canvas - crashing on iOS devices - appsloveworld
for iphone i get same problem, i got to fix with disabled pinch zoom in to make a image showing in screen you...
Read more >
Xcode Not Opening After Updating To Macos Catalina - ADocLib
Hi I have updated my mac os to 10.15 beta then after I am facing issues to build apk so I tried flutter...
Read more >
Fix html2canvas jQuery code - it crashes on iOS only
Basically, my code works perfectly on everything except iOS devices like an iPhone. The html2canvas code doesn't seem to trigger at all on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found