Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
svgToPrint = svg;
} else if (this.svg !== undefined && this.svg !== null) {
svgToPrint = this.svg;
} else {
// eslint-disable-next-line prefer-promise-reject-errors
return Promise.reject('No SVG for printing defined');
}
const png: string = await this.generateImageFromSVG('png', svgToPrint);
const printOptions: print.Configuration = {
printable: png,
type: 'image',
};
print(printOptions);
return Promise.resolve();
}