Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

245
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda