EasyQRCodeJS icon indicating copy to clipboard operation
EasyQRCodeJS copied to clipboard

Download without rendering

Open anuj9196 opened this issue 1 year ago • 0 comments

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);
}

anuj9196 avatar May 04 '24 19:05 anuj9196