Using C# QR Code Generator Library
How to generate, create QR Code 2d barcode in asp.net, windows application with free c# open source example?
- Easy integrated into .NET applications to generate QR Code with C#.NET class library
- Print valid matrix barcode QR Code images in ASP.NET websites and WinForms applications
- Support integrating 2D barcodes QR Code, Data Matrix & PDF-417 in Crystal Reports and RDLC Reports
- Draw and save QR Code bar codes in gif, jpeg, png, tiff, and bitmap formats with C#.NET programming
- Multiple properties for selection, such as QR Code version, data mode, ECL, Structure Append, etc
- A variety of barcode options are user-defined, including module width, height, resolution, orientation, etc
C# QR Code Barcode Generator Overview
Barcode Generator for .NET Suite is an easy-to-use barcode encoder component featuring QR Code generation & barcoding in .NET projects,
with which developers can easily integrate QR Code images in ASP.NET web forms, WinForms, C#.NET class & console applications.
Besides, the user-friendly interface provides easy access to customize generated QR Code images like size, orientation, resolution, and so on.
2D QR Code Barcode Description
QR Code, also named as Denso Barcode, QRCode, Quick Response Code, JIS X0510, ISO/IE18004, is a popular matrix barcode with fast readability and large storage capacity.
QR Code could be scanned by smart phones like Blackberry, iPhone, and Windows Phone 7.5.
Create QR Code in ASP.NET web apps in C#
This Barcode Generator control supports generating QR Code barcode images in ASP.NET web applications.
You can easily create QR Code in ASP.NET websites with control by dragging and dropping, stream QR Code barcode in website as url through Microsoft IIS,
or simple generate QR Code with Visual C# programming in ASP.NET web projects.
View
Generate QR Code using C# in ASP.NET Core web apps
Generate QR Code using C# in ASP.NET Core MVC web apps
How to generate barcode in C#.NET using ASP.NET.
Create QR Code in Windows .NET apps in C#
Users can also paint and draw high-quality QR Code barcodes in .NET Windows Forms applications.
You can directly drag the barcoding control to a Windows Form and get a QR Code image or create barcodes with Visual C# programming.
For more details, please view
How to create barcode using C# in .NET WinForms
Create barcode in .NET WPF Windows using C#
- numeric data (digits 0 - 9)
- alphanumeric data (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : )
- byte data (default: ISO/IEC 8859-1)
- Kanji characters
Create GS1 Compatible QR Code
- Set FNC1 to KeepAutomation.Barcode.FNC1.First
- In barcode data setting CodeToEncode, around AI code with "()", and followed by AI data, such as "(02)225(03)33344". Here "02", "03" are the AI code, "225", "33344" is the AI data,
Encode Special Chars or Non-printable Chars in QR Code
- Set TildeEnabled to true
- Use '~ddd' for non-printable chars. For example, ASCII char [GS] is non-printable, and its decimal value is 29. In barcode data, you need use ~029 for char [GS].
The following C# source codes demo how to encode byte[] object in QR Code
// Byte array to encode
byte[] dataBytes = new byte[] { 0x41, 0x42, 0x43, 0x44, 0x45 };
// Convert byte array to the input (property CodeToEncode)
String inputMsg = "";
foreach (byte b in dataBytes)
inputMsg += "~" + b.ToString().PadLeft(3, '0');
// Create barcode
BarCode barcode = new BarCode();
barcode.Symbology = Symbology.QRCode;
barcode.QRCodeDataMode = QRCodeDataMode.Byte;
// enable '~' in the input message
barcode.TildeEnabled = true;
barcode.CodeToEncode = inputMsg;
// set module size to 5 pixels
barcode.BarcodeUnit = BarcodeUnit.Pixel;
barcode.X = 5;
barcode.Y = 5;
barcode.generateBarcodeToBitmap().Save(@"C:\QRCode_Bytes.png");
Encode non-English text in QR Code
The following C# source codes demo how to encode non English text (such as Thai text) in QR Code
// Message in Thai
String unicodeMsg = @"สวัสดีตอนเช้าค่ะ";
// Convert Unicode string to data bytes
byte[] dataBytes = Encoding.Unicode.GetBytes(unicodeMsg);
// Convert byte array to the input (property CodeToEncode)
String inputMsg = "";
foreach (byte b in dataBytes)
inputMsg += "~" + b.ToString().PadLeft(3, '0');
// Create barcode
BarCode barcode = new BarCode();
barcode.Symbology = Symbology.QRCode;
barcode.QRCodeDataMode = QRCodeDataMode.Byte;
// enable '~' in the input message
barcode.TildeEnabled = true;
barcode.CodeToEncode = inputMsg;
Generate Barcode Image in Specified Width and Height
- Set property AutoSizeAdjust to true
- Set property DPI to be the same or higher as your printer's resolution
- Set property BarcodeUnit to inch or cm
- Set property BarCodeWidth and BarCodeHeight to your required image width and height
QR Code Property Settings
Please view the complete list of properties for QR Code generation at
QR Code generator property list for C#.NET code
How to Create QR Code in Class Library Using C#
Complete demo source code in C#:
How to create QR Code using C#?