Skip to content

Commit 5ced1a1

Browse files
docs(barcode):added qrcode documentation (#529)
* docs(barcode):added qrcode documentation * Update components/barcode/qrcode/overview.md Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> * Update components/barcode/qrcode/overview.md Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> * docs(barcode):fixes as per comments * docs(qrcode):added final fixes as per comments * docs(qrcode):added fix per last comment Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com>
1 parent e2fcd6f commit 5ced1a1

File tree

10 files changed

+244
-29
lines changed

10 files changed

+244
-29
lines changed

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ navigation:
240240
title: "Arc"
241241
"*autocomplete":
242242
title: "AutoComplete"
243+
"*barcodes":
244+
title: "Barcodes"
243245
"*barcode":
244246
title: "Barcode"
245247
"*togglebutton":
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Encoding
33
page_title: Barcode Encoding
44
description: Types of Encoding supported by the Barcode for Blazor.
5-
slug: components/barcode/encoding
5+
slug: barcode-encoding
66
tags: telerik,blazor,barcode,encoding
77
published: True
88
position: 3
@@ -16,28 +16,6 @@ You can choose which supported encoding to use by setting the `Type` paramater o
1616

1717
>important If the value of a particular encoding does not meet the expected length or character set, the barcode will **not** be shown.
1818
19-
| SYMBOLOGY | CHARACTER SET | LENGTH | CHECK DIGITS |
20-
| --------- | ------------- | ------ | ------------ |
21-
| **Code 39** (default) | [A-Z]; [0-9]; [ - . $ / + % ] | variable (avg. up to 20 chars) | optional (Mod. 43) |
22-
| **Code39Extended** | ASCII (128 characters) | variable | optional (Mod. 43) |
23-
| **Code 93** | [0-9];[A-Z];[SPACE . + - / % $] | variable | 2 check digits |
24-
| **Code93Extended** | ASCII(128 characters) | variable | 2 check digits |
25-
| **EAN-13** | numeric [0..9] | 12 usable digits | 1 check digit |
26-
| **EAN-8** | numeric [0..9] | 7 usable digits | 1 check digit |
27-
| **UPC-A** | numeric [0..9] | 11 usable digits (first is always 0) | 1 check digit |
28-
| **UPC-E** | numeric [0..9] | 6 usable digits (first is always 0) | 1 check digit |
29-
| **POSTNET** | numeric [0..9] | variable | 1 check digit |
30-
| **Code 11** | [0-9]; [-] | variable | 1 or 2 based on length |
31-
| **Code128** | LATIN-1 (ISO-8859-1) | variable | 1 check digit |
32-
| **Code128A** | ASCII 00 to 95 (0-9, A-Z and control codes), special characters | variable | 1 check digit |
33-
| **Code128B** | ASCII 32 to 127 (0-9, A-Z, a-z), special characters | variable | 1 check digit |
34-
| **Code128C** | ASCII 00-99 (encodes each two digits with one code) | variable | 1 check digit |
35-
| **GS1-128** | depending on Application Identifier | variable | 1 check digit |
36-
| **MSImod10** | numeric [0..9] | variable | 1 check digit |
37-
| **MSImod11** | numeric [0..9] | variable | 1 check digit |
38-
| **MSImod1010** | numeric [0..9] | variable | 1 check digit |
39-
| **MSImod1110** | numeric [0..9] | variable | 1 check digit |
40-
4119
>caption Explore the Barcode Type options
4220
4321
````CSHTML
@@ -66,6 +44,28 @@ You can choose which supported encoding to use by setting the `Type` paramater o
6644
}
6745
````
6846

47+
| SYMBOLOGY | CHARACTER SET | LENGTH | CHECK DIGITS |
48+
| --------- | ------------- | ------ | ------------ |
49+
| **Code 39** (default) | [A-Z]; [0-9]; [ - . $ / + % ] | variable (avg. up to 20 chars) | optional (Mod. 43) |
50+
| **Code39Extended** | ASCII (128 characters) | variable | optional (Mod. 43) |
51+
| **Code 93** | [0-9];[A-Z];[SPACE . + - / % $] | variable | 2 check digits |
52+
| **Code93Extended** | ASCII(128 characters) | variable | 2 check digits |
53+
| **EAN-13** | numeric [0..9] | 12 usable digits | 1 check digit |
54+
| **EAN-8** | numeric [0..9] | 7 usable digits | 1 check digit |
55+
| **UPC-A** | numeric [0..9] | 11 usable digits (first is always 0) | 1 check digit |
56+
| **UPC-E** | numeric [0..9] | 6 usable digits (first is always 0) | 1 check digit |
57+
| **POSTNET** | numeric [0..9] | variable | 1 check digit |
58+
| **Code 11** | [0-9]; [-] | variable | 1 or 2 based on length |
59+
| **Code128** | LATIN-1 (ISO-8859-1) | variable | 1 check digit |
60+
| **Code128A** | ASCII 00 to 95 (0-9, A-Z and control codes), special characters | variable | 1 check digit |
61+
| **Code128B** | ASCII 32 to 127 (0-9, A-Z, a-z), special characters | variable | 1 check digit |
62+
| **Code128C** | ASCII 00-99 (encodes each two digits with one code) | variable | 1 check digit |
63+
| **GS1-128** | depending on Application Identifier | variable | 1 check digit |
64+
| **MSImod10** | numeric [0..9] | variable | 1 check digit |
65+
| **MSImod11** | numeric [0..9] | variable | 1 check digit |
66+
| **MSImod1010** | numeric [0..9] | variable | 1 check digit |
67+
| **MSImod1110** | numeric [0..9] | variable | 1 check digit |
68+
6969
## See Also
7070

7171
* [Live Demo: Barcode](https://demos.telerik.com/blazor-ui/barcode/overview)

components/barcode/images/barcode-basic-configuration.PNG renamed to components/barcodes/barcode/images/barcode-basic-configuration.PNG

File renamed without changes.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Overview
33
page_title: Barcode Overview
44
description: Overview of the Barcode for Blazor.
5-
slug: components/barcode/overview
5+
slug: barcode-overview
66
tags: telerik,blazor,barcode,overview
77
published: True
88
position: 0
@@ -21,10 +21,10 @@ To add a Telerik Barcode to your Blazor app:
2121
1. Add the `TelerikBarcode` tag.
2222
1. Provide `Value` property
2323
1. Set its `Height` and `Width`
24-
1. Optionally, choose a `Type` (one of the [encodings we support]({%slug components/barcode/encoding%})).
24+
1. Optionally, choose a `Type` (one of the [encodings we support]({%slug barcode-encoding%})).
2525
* Its default encoding is `Code39`.
2626

27-
The following example demonstrates how to initialize the Barcode with its default configuration.
27+
The following example demonstrates how to set up the Barcode with its default configuration.
2828

2929
>caption A basic configuration of the Telerik Barcode
3030
@@ -39,19 +39,19 @@ The following example demonstrates how to initialize the Barcode with its defaul
3939
4040
![](images/barcode-basic-configuration.png)
4141

42-
For more information, refer to the [article on encoding]({%slug components/barcode/encoding%}) regarding the set of types supported by the Barcode.
42+
For more information, refer to the [article on encoding]({%slug barcode-encoding%}) regarding the set of types supported by the Barcode.
4343

4444
## Features
4545

4646
>caption The Barcode provides the following features:
4747
4848
### General Properties
4949

50-
* `RenderAs` - `enum` - defines the preferred rendering engine - svg/canvas.
50+
* `RenderAs` - `enum` - defines the preferred rendering mode - svg/canvas.
5151

5252
* `Checksum` - `bool` - by setting it to true, the Barcode will display the checksum digit next to the value in the text area.
5353

54-
* `Type` - `enum` - defines the symbology (encoding) the Barcode will use - ([full list of supported encodings]({%slug components/barcode/encoding%}))
54+
* `Type` - `enum` - defines the symbology (encoding) the Barcode will use - ([full list of supported encodings]({%slug barcode-encoding%}))
5555

5656
* `Value` - `string` - defines the initial value of the Barcode.
5757

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Encoding
3+
page_title: QRCode Encoding
4+
description: Types of Encoding supported by the QRCode for Blazor.
5+
slug: qrcode-encoding
6+
tags: telerik,blazor,barcode,qrcode,encoding
7+
published: True
8+
position: 3
9+
---
10+
11+
# QRCode Encoding
12+
The different types of QRCode values support different **conventions** and **formatting** accordingly.
13+
14+
In many cases, the value of the QRCode is processed by the device in a special way. For example, geolocations are displayed in the Global Positioning System (GPS) or Map application on the device, URLs are opened by the browser, and so on.
15+
16+
# URL
17+
To encode the text of a URL, for example, https://docs.telerik.com/blazor-ui/introduction, encode the `https://docs.telerik.com/blazor-ui/introduction` URL text in the QRCode. Include the `http://` protocol to ensure it is recognized as a URL.
18+
19+
# Email Addresses
20+
To encode an email address, for example, `blazor@telerik.com`, encode `blazor@telerik.com`. To ensure the value is recognized as an email address, create a proper `mailto` Uniform Resource Identifier (URI) from the address (`mailto:blazor@telerik.com`). As a result, readers can open a blank email message to the specified email destination.
21+
22+
# Telephone Numbers
23+
To encode a telephone number, use a telephone URI to ensure that the digits are recognized as a telephone number and include prefixes which make the number internationally accessible. For example, to encode the `212-555-1212` US telephone number, encode `tel:+1-212-555-1212`. This telephone URI contains a `+1` prefix that makes it usable outside the United States. As a result, even though readers cannot automatically initiate a call, they can invoke the device dialer (if applicable) and pre-fill it with the specified number.
24+
25+
# Contact Information
26+
To encode contact information as text, use the [vCard](https://en.wikipedia.org/wiki/VCard) format. This format is too verbose to use in 2D QRCodes whose information capacity is limited. It is not clear whether vCard is or has to be used to encode contact information. As a result, readers can open a new address book entry that is populated with the provided data and prompt the user to add a new contact.
27+
28+
# SMS
29+
Similar to email addresses, to encode an SMS short code or number, create an SMS URI. For example, to create a link to the `12345` number, encode `sms:12345`. You may use other URI forms, such as `sms:number:subject`, and other prefixes, such as `smsto:`. As a result, readers can open a new SMS message that is ready for users to compose and send it.
30+
31+
# Geolocations
32+
To encode a point on the earth, including altitude, use a geo URI. For example, to encode the Progress office in Bulgaria, encode `geo:42.65049,23.37925,100`. As a result, readers can either open a local mapping application to this location, such as [Google Maps](https://www.google.bg/maps/), and zoom accordingly, or a link to this location on a mapping website such as Google Maps in the web browser of the device.
4.67 KB
Loading
6.19 KB
Loading
7.26 KB
Loading
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: Overview
3+
page_title: QRCode Overview
4+
description: Overview of the QRCode for Blazor.
5+
slug: qrcode-overview
6+
tags: telerik,blazor,barcode,qrcode,overview
7+
published: True
8+
position: 0
9+
---
10+
11+
# QRCode Overview
12+
13+
The QRCode generates **Canvas** and **SVG** images that represent Quick Response (QR) codes.
14+
15+
The generated image from the component is a machine-readable label that contains information about data for a locator, identifier, or tracker that points to a website or application.
16+
17+
## Basics
18+
19+
To add a Telerik QRCode to your Blazor app:
20+
21+
1. Add the `TelerikQRCode` tag.
22+
1. Provide `Value` property
23+
1. Set its `Size`
24+
1. Optionally, choose a `QRCode Type` (one of the [types we support]({%slug qrcode-qr-code-types%})).
25+
26+
The following example demonstrates how to set up the QRCode with its default configuration.
27+
28+
>caption A basic configuration of the Telerik QRCode
29+
30+
````CSHTML
31+
@* This code snippet showcases an example of basic a QRCode configuration. *@
32+
33+
<TelerikQRCode Size="200px"
34+
Value="https://docs.telerik.com/blazor-ui/introduction">
35+
</TelerikQRCode>
36+
````
37+
38+
>caption The result from the above code snippet
39+
40+
![](images/qrcode-basic-configuration.png)
41+
42+
For more information, refer to the [article on types]({%slug qrcode-qr-code-types%}) regarding the set of QRCode types.
43+
44+
## Features
45+
46+
>caption The QRCode provides the following features:
47+
48+
### General Properties
49+
50+
* `RenderAs` - `enum` - `RenderingMode` - defines the preferred rendering mode:
51+
* `SVG`
52+
* `Canvas`
53+
54+
* `Encoding` - `enum` - `QRCodeEncoding` - the encoding mode used to encode the value. The possible members are:
55+
* `ISO_8859_1` - supports all characters from the ISO/IEC 8859-1 character set.
56+
* `UTF_8` - supports all Unicode characters. The UTF-8 encoding is not included in the specifications and is not supported by all readers.
57+
58+
* `ErrorCorrection` - `enum` - `QRCodeErrorCorrection` - the error correction level used to encode the value. The possible values are:
59+
* `L` - approximately 7% of the codewords can be restored.
60+
* `M` - approximately 15% of the codewords can be restored.
61+
* `Q` - approximately 25% of the codewords can be restored.
62+
* `H` - approximately 30% of the codewords can be restored.
63+
64+
* `Value` - `string` - defines the initial value of the QRCode.
65+
66+
* `Size` - `string` - specifies the size (`Width` and `Height`) of a QR code in pixels (i.e. "200px") as the QRCode is a square. You can read more details for the dimension properties in the [Dimensions article](https://docs.telerik.com/blazor-ui/common-features/dimensions#dimensions). Setting both `Size` and `Width` and/or `Height` will throw an error. Setting different values to `Width` and `Height` will also cause an issue.
67+
68+
* `Width` - `string` - sets the width of the QRCode. If `Height` is set and the `Size` property is not set, the same value as `Width` should be set to `Height`.
69+
70+
* `Height` - `string` - sets the height of the QRCode. If `Height` is set and the `Size` property is not set, the same value as `Height` should be set to `Width`.
71+
72+
* `Class` - `string` - the CSS class that will be rendered on the main wrapping element of the QRCode component.
73+
74+
* `Background` - `string` - the background color of the QRCode. Accepts a valid CSS color string, including HEX and RGB.
75+
76+
* `Color` - `string` - defines the color of the QRCode elements. The default color is black.
77+
78+
* `Padding` - `double` - defines the minimum distance in pixels that should be left between the border and the QR modules.
79+
80+
### Properties for the QRCode Overlay
81+
82+
* `QRCodeOverlay` - `object` - the overlay configuration which allows you to choose from predefined layouts or insert a custom image.
83+
84+
* `QRCodeOverlay.Type` - `enum` - `QRCodeOverlayType` - available options are `Image` and `Swiss`. When set to image, you have to specify the url source of the image. If set to swiss, a [Swiss QR Code](https://blog.xsuite.com/en/swiss-qr-code#:~:text=This%20QR%20code%20is%20called,(e.g.%20in%20PDF%20format).) is created.
85+
86+
* `QRCodeOverlay.ImageUrl` - `string` - the URL of the displayed overlay image.
87+
88+
* `QRCodeOverlay.Width` - `double` - the width of the overlay in pixels.
89+
90+
* `QRCodeOverlay.Height` - `double` - the height of the overlay in pixels.
91+
92+
### Properties for the QRCode Border
93+
94+
* `QRCodeBorder` - `object` - the border of the QR code.
95+
96+
* `QRCodeBorder.Color` - `string` - the color of the border. Accepts a valid CSS color string, including HEX and RGB.
97+
98+
* `QRCodeBorder.Width` - `double` - The width of the border in pixels. By default the border width is set to zero which means that the border will not be visible.
99+
100+
## Methods
101+
102+
The QRCode methods are accessible through its reference.
103+
104+
* `Refresh` - redraws the component.
105+
106+
You can see the [example with the Barcode](https://docs.telerik.com/blazor-ui/components/barcode/overview#methods) and use the `Refresh()` method in the same way with QRCode.
107+
108+
## See Also
109+
110+
* [Live Demo: QRCode](https://demos.telerik.com/blazor-ui/qrcode/overview)
111+
* [Live Demo: QRCode Encoding](https://demos.telerik.com/blazor-ui/barcode/qrcode/encoding)
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: QR Code Types
3+
page_title: QR Code Types
4+
description: Overview of the QR Code Types for Blazor.
5+
slug: qrcode-qr-code-types
6+
tags: telerik,blazor,barcode,qrcode,types,overview
7+
published: True
8+
position: 5
9+
---
10+
11+
# QRCode Types
12+
13+
The component exposes the following QRCode types:
14+
15+
* [Swiss Type](#swiss-qrcode-type)
16+
* [Image Type](#image-qrcode-type)
17+
18+
## Swiss QRCode Type
19+
The QRCode component supports the [Swiss QR Code format](https://blog.xsuite.com/en/swiss-qr-code). Enabling the `Swiss` type of the overlay will add a Swiss cross in the QR Code.
20+
21+
The following implementation demonstrates the code needed for the Swiss Type:
22+
23+
>caption An example of a Swiss QR Type implementation
24+
25+
````CSHTML
26+
@* This code snippet showcases an example of Swiss type QR code. *@
27+
28+
<TelerikQRCode Size="200px"
29+
Value="@value">
30+
<QRCodeOverlay Type="@QRCodeOverlayType.Swiss" />
31+
</TelerikQRCode>
32+
33+
@code {
34+
string value = "SPC 0200 1 CH4431999123000889012 S " +
35+
"Robert Schneider AG Rue du Lac 1268 2501 Biel CH 1949.75 CHF " +
36+
"S Pia-Maria Rutschmann-Schnyder Grosse Marktgasse 28 9400 Rorschach CH " +
37+
"QRR 210000000003139471430009017 Order of 15 June 2020 EPD " +
38+
"//S1/10/10201409/11/200701/20/140.000-53/30/102673831/31/200615/32/7.7/33/7.7:139.40/40/0:30" +
39+
" Name AV1: UV;UltraPay005;12345 Name AV2: XY;XYService;54321";
40+
}
41+
````
42+
43+
>caption The result from the above code snippet
44+
45+
![](images/qrcode-swiss-type.png)
46+
47+
## Image QRCode Type
48+
The image type of the overlay is adding an image in the QR Code.
49+
50+
The following implementation demonstrates the code needed for the Image Type:
51+
52+
>caption An example of a QRCode Image Type implementation
53+
54+
````CSHTML
55+
@* This code snippet showcases an example of image type QR code. *@
56+
57+
<TelerikQRCode Size="200px"
58+
Value="https://demos.telerik.com/blazor-ui">
59+
<QRCodeOverlay Type="@QRCodeOverlayType.Image" ImageUrl="https://demos.telerik.com/kendo-ui/content/shared/images/site/kendoka-cta.svg" />
60+
</TelerikQRCode>
61+
````
62+
63+
>caption The result from the above code snippet
64+
65+
![](images/qrcode-image-type.png)
66+
67+
## See Also
68+
69+
* [Live Demo: QRCode](https://demos.telerik.com/blazor-ui/qrcode/overview)
70+
* [Live Demo: QRCode Encoding](https://demos.telerik.com/blazor-ui/barcode/qrcode/encoding)

0 commit comments

Comments
 (0)