Angularx-qrcode Work Download Image May 2026
Determines the format. Use 'canvas' , 'img' , or 'url' for .png downloads. Use 'svg' for .svg files.
Allows you to embed a logo (e.g., ./logo.png ) inside the QR code (Canvas only). Advanced: Programmatic Download with a Button angularx-qrcode download image
Choose from 'L' , 'M' , 'Q' , or 'H' to balance data density vs. damage resistance. Determines the format
import { SafeUrl } from '@angular/platform-browser'; export class MyComponent { public qrdata: string = 'https://example.com'; public qrCodeDownloadLink: SafeUrl = ""; // Triggered when the QR code is generated onChangeURL(url: SafeUrl) { this.qrCodeDownloadLink = url; } } Use code with caution. Allows you to embed a logo (e
If you prefer a button instead of a direct link, you can trigger the download programmatically by creating a temporary anchor element. This method is useful if you need to fetch the image source directly from the DOM. typescript
To download a QR code image using the library, you can leverage the built-in (qrCodeURL) event emitter, which provides a sanitized data URL whenever the QR code is generated or updated. This URL can then be bound to a standard anchor tag with the download attribute to trigger a local file save. Quick Start: Downloading a QR Code as PNG