jszip
jszip copied to clipboard
ADD: Documentation Example
FIX: Error: Invalid base64 input, it looks like a data url.
Example on how to work with canvas images.
code:
var zip = new JSZip();
var img = zip.folder("images");
html2canvas(document.querySelector("#chart_placeholder_0")).then(canvas => {
img.file("imr.png", canvas.toDataURL("image/png", [0.0, 1.0]).split(',')[1], { base64: true });
});
zip.generateAsync({ type: "blob" }).then(function (content) {
saveAs(content, "example.zip");
});
Dupe of #694
I have same question