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

243
Views
Problema de descarga de html2canvas con teléfonos Android

Así que hice un script que captura un div de mi sitio web y comienza a descargarse automáticamente.

El problema es que solo funciona en PC. Probé con un montón de teléfonos Android y la imagen no se descarga y da un error de que no se puede descargar. que debo hacer para esta situacion?

El código :

 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

Bueno, obtuve la respuesta yo mismo después de lidiar con el problema durante horas, me di cuenta de que todo lo que tenía que hacer era agregar algunas líneas.

nuevo código :

 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!