                         .removeChild(a);
                            };
                            img.src = 'data:image/svg+xml;base64,' + svgBase64;
                        } else if (format === 'pdf') {
                            const img = new Image();
                            img.onload = function () {
                                const canvas = document.createElement('canvas');
                                canvas.width = this.width;
                                canvas.height = this.hei