Created
October 30, 2021 04:37
-
-
Save camilamoreiradev/166a308a3c9f81cb95ff9529297f218b to your computer and use it in GitHub Desktop.
Criar um botão js e nele colocar o código passando o id da div que quer imprimir na imagem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Swal.fire({ | |
title: 'Aguarde...', | |
html: 'Estamos gerando a IMAGEM com as informações da tela.', | |
timerProgressBar: true, | |
didOpen: () => { | |
Swal.showLoading() | |
} | |
}); | |
setTimeout(function(){ | |
html2canvas(document.getElementById("container-print"), { | |
onrendered: function (canvas) { | |
var link = document.getElementById('btn_jpg_link'); | |
link.href = canvas.toDataURL('image/jpeg'); | |
$('#btn_jpg_link')[0].click(); | |
Swal.close(); | |
} | |
}); | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment