Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
html2canvas downloading problem with android phones

So I made a script that captures a div of my website and it starts downloading automatically.

The problem is that it only works on PC. I tried with a bunch of android phones and the picture does not download and gives an error that it can not be downloaded. what should I do for this situation?

The code :

html2canvas(document.getElementById("ssss"), {
  useCORS: true
    }).then(function (canvas) {
  var imageURL = canvas.toDataURL("image/jpeg");
  let a = document.createElement("a");
  a.href = imageURL;
  a.download = imageURL;
  a.click();
});

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Well I got the answer myself after dealing with the problem for hours I realized that all I needed to do was to add a few lines.

new Code :

    html2canvas(document.getElementById("image-div-id"), {
        imageTimeout: 15000, //newline
        scale:3, //newline
        useCORS: true
}).then(function (canvas) {
  var imageURL = canvas.toDataURL("image/jpg");
  let a = document.createElement("a");
  a.href = imageURL;
  a.download = "letter.jpg";
  a.click();
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!