Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download without rendering #89

Open
anuj9196 opened this issue May 4, 2024 · 0 comments
Open

Download without rendering #89

anuj9196 opened this issue May 4, 2024 · 0 comments

Comments

@anuj9196
Copy link

anuj9196 commented May 4, 2024

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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant