You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ej2-asp-core-mvc/barcode/qrcodegenerator.md
+24-7Lines changed: 24 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -88,29 +88,46 @@ The dimension of the QR Code can be changed using the height and width propertie
88
88
{% endif %}
89
89
90
90
91
+
## Enhancing QR Codes with Icons
91
92
92
-
## Customizing the text
93
+
The EJ2 Barcode Generator allows you to add a [`logo`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.BarcodeGenerator.QRCodeGenerator.html#Syncfusion_EJ2_BarcodeGenerator_QRCodeGenerator_Logo) or icon to your QR codes, enhancing their visual appeal, clarity, and even security. Adding a recognizable icon can make it easier for users to identify the source and help prevent tampering.
93
94
94
-
In QR Code generators, you can customize the QR Code text by using display text property.
95
+
### Supported Image Sources
96
+
97
+
The `imageSource` property of the `QRCodeLogo` class supports the following image sources:
98
+
99
+
-**Local image path**: Specify the path to the image file relative to your project's root directory (e.g., `images/syncfusion.png`) or as an absolute path (e.g., `/assets/icons/logo.svg`).
100
+
-**Remote image URL**: Provide the web address of the image file (e.g., `https://example.com/image.jpg`).
101
+
-**Base64 encoded image data**: Embed the image data directly in the code using a Base64-encoded string (e.g., `data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...`).
102
+
103
+
### Logo Dimensions
104
+
105
+
The `width` and `height` properties of the `QRCodeLogo` class define the dimensions of the logo in pixels. If not specified, both default to 30% of the QR code’s size. The maximum allowed size is 30% of the QR code’s dimensions to ensure optimal readability.
106
+
107
+
**Note:** Always test the readability of your QR code after adding a logo. Depending on the logo size and QR code content, you might need to adjust the [`errorCorrectionLevel`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.BarcodeGenerator.ErrorCorrectionLevel.html) property of the `QRCodeGenerator` to `"Medium"` or `"High"` for better reliability.
108
+
109
+
The following image illustrates QR code with logo:
110
+
111
+

95
112
96
113
{% if page.publishingplatform == "aspnet-core" %}
97
114
98
115
{% tabs %}
99
116
{% highlight cshtml tabtitle="CSHTML" %}
100
-
{% include code-snippet/barcode/qrcode/text/tagHelper %}
117
+
{% include code-snippet/barcode/qrcode/logo/tagHelper %}
0 commit comments