KA.Barcode Generator for .NET Suite
How to Print QR Code in C# with Valid Data
Complete C#.NET source code to generate, print QR Code images using Barcode Generator for .NET Suite
  • Mature QR Code Barcode Generator component for .NET with outstanding quality and versatility
  • Support matrix QR Code generation & creation in .NET development environments like MS Visual Studio
  • Provide detailed ASP.NET barcode integration, Java barcode tutorial & Excel barcode creation guides for users
  • Dynamically print, draw QR Code pictures in Windows Forms, insert in ASP.NET web applications in C# programming
  • Simple to encode multiple data types in QR Code, such as numeric, alphanumeric, byte data and Kanji characters.
  • Various QR Code bar code data formats to select for the maximum data density
  • Supports ASP.NET EAN 128 , ISBN Word, UPC-A .NET WinForms, Codabar Word and many other barcode types
  • Generating, printing high-quality QR Code matrix barcode images with fast readability and large storage capacity
  • Compatible with the latest ISO/IEC 18004 QR Code specifications to ensure scannability of generated images
KA.Barcode Generator for .NET Suite is a high-quality barcode generation component SDK API for developers to create, insert QR Code barcode images in .NET development environment. Detailed tutorials with demo codes are provided to guide you encode valid data for QR Codes, set barcodes with proper size, and save images in different file formats.
QR Code Introduction
QR Code is a pupular bidimensional barcode symbology which is also named Denso Barcode, QRCode, Quick Response Code, JIS X0510, ISO/IE18004.

Valid Data

  • Numeric & Alphanumeric data: 0-9, A-Z, a-z and nine special characters: space, & % * + - . / :
  • Kanji characters

Valid Length

  • QR Code barcode has a variable-length.
  • Alphanumeric data: up to 2335 characters (maximum)
  • 8-bit byte data: 1555 characters
  • Numeric data; 3116 digits
QR Code Data Encoding in KA.Barcode Generator for .NET Suite

Procedures to Install QR Code into .NET C# Projects

  1. 1.
  2. 2.
    Add Reference: Add "KeepAutomation.Barcode.Window.dll" to your .NET WinForms project reference.
  3. 3.
    Add to Toolbox: Add BarCodeControl to your .NET Visual Studio toolbox.
Copy the following C#.NET sample code onto your project to create a QR Code barcode image
using KeepAutomation.Barcode.Bean;

BarCode qrcode = new BarCode();
qrcode.Symbology = KeepAutomation.Barcode.Symbology.QRCode;
qrcode.CodeToEncode = "C#qrdemo";
qrcode.X = 3;
qrcode.Y = 3;
qrcode.generateBarcodeToImageFile("C:/qr_csharp.png");

Generate QR Code in AlphaNumeric Data Mode

KeepAutomation QR Code AlphaNumeric data mode allows you to encode digits 0-9, upper-case letters A - Z, and nine other characters: space, & % * + - . / :
qrcode.QRCodeDataMode = QRCodeDataMode.AlphaNumeric;
qrcode.CodeToEncode = "QR12%";

Create QR Code in Byte Data Mode

Byte Data Mode for QR Code allows you to encode ISO/IEC 8859-1 at default.
qrcode.QRCodeDataMode = QRCodeDataMode.Byte;
qrcode.CodeToEncode = "QRtest12";

Print QR Code in Kanji Data Mode

Kanji Data Mode for QR Code allows you to encode Kanji characters in accordance with the Shift JIS system based on JIS X 0208. In this data format, each two-byte character value is compacted to a 13-bit binary codeword.
qrcode.QRCodeDataMode = QRCodeDataMode.Kanji;

Draw QR Code in Numeric Data Mode

QR Code Numeric Data Mode allows you to encode numeric data: digits 0 – 9.
qrcode.QRCodeDataMode = QRCodeDataMode.Numeric;
qrcode.CodeToEncode = "1234";
Note: If you are not sure which data mode is proper for your encoding data, you can select QR Code Auto mode, KA.Barcode Generator for .NET Suite will automatically print valid QR Code images according to your input data.