I have added the below code to download the diagram as a png image. The image icons in the nodes is not displaying. I am implementing this feature in Angular 9. Please let me know if I am missing anything.
public myCallback(blob) {
var url = window.URL.createObjectURL(blob);
var filename = “myBlobFile.png”;
var a = document.createElement("a");
//a.style = "display: none";
a.href = url;
a.download = filename;
// IE 11
if (window.navigator.msSaveBlob !== undefined) {
window.navigator.msSaveBlob(blob, filename);
return;
}
document.body.appendChild(a);
requestAnimationFrame(function () {
a.click();
window.URL.revokeObjectURL(url);
document.body.removeChild(a);
});
}
public makeBlob() {
var blob = this.dia.makeImageData({ background: “white”, returnType: “blob”, callback: this.myCallback });
}