Cordobo / angularx-qrcode

A fast and easy-to-use Angular QR Code Generator library with Ivy support
https://cordobo.github.io/angularx-qrcode/
MIT License
465 stars 126 forks source link

Question: Download QR code as an image #117

Closed charindukavishan closed 3 years ago

charindukavishan commented 3 years ago

Is there an API for download QR code as an image in this library?

Cordobo commented 3 years ago

Hi @charindukavishan

thanks for your question. Could you let me know

1) what's the purpose of downloading the image and 2) how's the users process to download the website/app, e.g. clicking on the image or having a separate button "download as image"? 3) what do you as a developer expect from the API?

charindukavishan commented 3 years ago
  1. I want to print the QR code image
  2. Yes. I need to download the QR code image by clicking a separate button
  3. I expect a function for download the QR code as an image file (png/jpg)
foramkumar-parekh commented 3 years ago
  1. I want to print the QR code image
  2. Yes. I need to download the QR code image by clicking a separate button
  3. I expect a function for download the QR code as an image file (png/jpg)

Directly download is not available, but you can achieve it using file saver.

this package creates the QR code inside the canvas. so you can

  1. get the canvas element
  2. convert it to blob
  3. use file saver to save the file
charindukavishan commented 3 years ago

thank you for your support :)