Telerik blogs

A typical scenario is for someone to browse a website on his computer, and then to wish to open a link of the site on his cellphone. It would be easier for the person to open it, if it’s encoded as an image that the phone can directly read, because smartphones cannot understand human readable text, but most of them can read images, called QR codes.

What are QR (Quick Response) codes and how are they used?

The QR is a two-dimensional code. It looks like a matrix which consists of black square dots (modules) on a white background. Text information can be encoded into such QR Codes, called just symbols. These code symbols can be used to encode data that needs to be easily scanned using a QR Code scanner.

QR Codes are becoming more and more popular each day, because a variety of information can be stored inside them. Text, Phone numbers, Emails, URL and all kind of taking numbers can be stored in such symbols. If a link is encoded as a QR Code, a person can just take a snapshot of it with his cellphone and use a QR Code scanner application to read the symbol instead of retyping the URL by hand. Most of these apps are free and anyone can use them, so practically every smartphone can become a scanner.

RadBarcode now supports QR Code generating 

In Q3 2012 we implemented QR Code rendering for our ASP.NET AJAX Barcode control. Our goal was to make the generation of such codes as easy as possible. So generally all you have to do is to set Type and Text of the RadBarcode control and a QR Code symbol will be generated.

Example ASP markup:

<telerik:RadBarcode runat="server" Type="QRCode" Text="an example">
</telerik:RadBarcode>

Result:

 'an example' encoded as QR Code

At the same time the QR code is highly customizable. A collection called QRCodeSettings is holding properties for further customization of the control. It includes the following ones: ErrorCorrectionLevel, ApplicationIndicator, FNC1, Mode, ECI, Version, DotSize. You can read information for all of them in our documentation. You can test the different configurations of the QR code in our demos.

QR code rendering types

The QR code also has two types of rendering: SVG and PNG.  By default the SVG rendering is used. And you can set OutputType="EmbeddedPNG" to make it render as Data URL, in this case the PNG image will be embedded into the HTML markup using base 64 encoding.

What’s next?

PNG output for the rest of the barcode types is currently under development. For the next release it will be supported for all RadBarcode types as is now supported for the QRCode mode.

We are also planning to release an export support for RadBarcode. So if you have barcodes inside your grid, you will be able to export them to PDF.

If you have any suggestions or questions join in the discussions in our forum, we will be glad to hear your feedback.


About the Author

Vasil Raev

 was a Software Developer at Telerik's ASP.NET AJAX divisions.

Related Posts

Comments

Comments are disabled in preview mode.