EasyQRCodeJS
EasyQRCodeJS copied to clipboard
Download without rendering
Using the library in Angular 17.
I want to download the image without rendering the QR code in the DOM. I see there is a NojeJs package but I want to do it in the frontend only.
I tried the following code, to create an element and use it, but it downloads a broken file.
download2(name = 'qrcode2') {
const options = {
text: 'hello world',
width: 150,
height: 150,
quietZone: 10
}
const div = document.createElement('div');
div.style.display = 'none';
this.renderer.appendChild(document.body, div);
new QRCode(div, options).download(name);
}