| Server IP : 162.214.74.102 / Your IP : 216.73.217.46 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/www/lrsys_apps/leo/application/plugins/module_imobles/assets/js/ |
Upload File : |
function saveImages(images) {
var zip = new JSZip();
images.forEach(function (canvas, index) {
var dataURL = canvas.toDataURL("image/jpeg", 0.8);
var img = dataURL.replace(/^data:image\/(png|jpeg);base64,/, "");
zip.file("flyer_" + index + ".jpg", img, {base64: true});
});
zip.generateAsync({type:"blob"}).then(function(content) {
saveAs(content, `apresentacao_${(new Date().toJSON().slice(0,19))}.zip`);
});
}
function getImages(){
var classesNodeList = document.querySelectorAll(".imageContainer");
var images = [];
var promises = Array.prototype.map.call(classesNodeList, function(element) {
return html2canvas(element).then(
res=>{
images.push(res);
}
).catch(error=>console.log(error));
});
Promise.all(promises).then((values) => {
saveImages(images);
});
}
document.addEventListener("DOMContentLoaded", () => {
getImages();
});