barcodelib.com Home

View More Information about BarcodeLib.com Barcode for .NET, ASP.NET



QRCode Barcode for .NET, ASP.NET

It is also known as Denso Barcode, QRCode, Quick Response Code, JIS X 0510, ISO/IEC18004

Quick Navigate
  1. Barcode Introduction
  2. Basic Characteristics
  3. Encoding Data Scope
  4. How to Generate Barcode Image in IIS without Visual Studio .NET?
  5. How to Generate Barcode Image through Web Controller in ASP.NET?
  6. How to Generate Barcode Image through Windows Controller in .NET?
  7. How to Generate Barcode Image in .NET class?
  8. How to Save Barcode Image?
  9. Barcode Property Settings
For trial version only, we will randomly print message BarcodeLib.com or Trial Version on the generated barcode image.
1. Barcode Introduction
QR Code is a kind of 2-D (two-dimensional) symbology developed by Denso Wave (a division of Denso Corporation at the time) and released in 1994 with the primary aim of being a symbol that is easily interpreted by scanner equipment.

QR Code is capable of handling all types of data, such as numeric and alphabetic characters, Kanji, Kana, Hiragana, symbols, binary, and control codes.

The symbol versions of QR Code range from Version 1 to Version 40. Each version has a different module configuration or number of modules (the module refers to the black and white dots that make up QR Code). "Module configuration" refers to the number of modules contained in a symbol, commencing with Version 1 (21 x 21 modules) up to Version 40 (177 x 177 modules). Each higher version number comprises 4 additional modules per side. Each QR Code symbol version has the maximum data capacity according to the amount of data, character type and error correction level. In other words, as the amount of data increases, more modules are required to comprise QR Code, resulting in larger QR Code symbols.

QR Code has error correction capability to restore data if the code is dirty or damaged. Four error correction levels are available for users to choose according to the operating environment. Raising this level improves error correction capability but also increases the amount of data QR Code size. To select error correction level, various factors such as the operating environment and QR Code size need to be considered. Level Q or H may be selected for factory environment where QR Code gets dirty, whereas Level L may be selected for clean environment with the large amount of data. Typically, Level M (15%) is most frequently selected. The QR Code error correction feature is implemented by adding a Reed-Solomon Code to the original data.
2. Basic Characteristics
QR Code is a matrix symbology with the following characteristics:
  1. Formats: QR Code, with full range of capabilities and maximum data capacity;
  2. Encodable character set:
    • 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.
  3. Version (Symbol size) (not including quiet zone): 21 x 21 modules to 177 x 177 modules (Versions 1 to 40, increasing in steps of four modules per side).
  4. Maximum QR Code symbol size, Version 40-L:
    • numeric data: 7089 characters
    • alphanumeric data: 4296 characters
    • Byte data: 2953 characters
    • Kanji data: 1817 characters
  5. Selectable error correction level:
    Four levels of Reed-Solomon error correction (referred to as L, M, Q and H in increasing order of capacity) allowing recovery of:
    • L 7%
    • M 15%
    • Q 25%
    • H 30%
    of the symbol codewords.
  6. Structured Append: This allows files of data to be represented logically and continuously in up to 16 QR Code symbols. These may be scanned in any sequence to enable the original data to be correctly reconstructed.
  7. Extended Channel Interpretations: This mechanism enables data using character sets other than the default encodable set (e.g. Arabic, Cyrillic, Greek) and other data interpretations (e.g. compacted data using defined compression schemes) or other industry-specific requirements to be encoded.
  8. FNC1 Mode: FNC1 mode is used for messages containing specific data formats. In the "1st position" it designates data formatted in accordance with the GS1 General Specifications. In the "2nd position" it designates data formatted in accordance with a specific industry application previously agreed with AIM Inc. FNC1 mode applies to the entire symbol and is not affected by subsequent mode indicators.
3. Encoding Data Scope
QRCode Barcode for .NET, ASP.NET supports:
4. How to Generate Barcode Image in IIS without Visual Studio .NET?
  1. Copy folder barcode from your downloaded package, to your IIS folder, e.g. C:\Inetpub.
  2. Create a new virtual directory, named barcode.
  3. Restart IIS.
  4. Test your installation, goto http://YourDomain:port/barcode/qrcode.aspx?Data=123450
  5. To create barcode image in your ASP.NET application, you can pass the url to IMG tag src value. For example, <img src="http://YourDomain:port/barcode/qrcode.aspx?Data=123450" />
5. How to Generate Barcode Image through Web Controller in ASP.NET?
  1. Integrate Barcode Controller to your ASP.NET project.
    1. Copy BarcodeLib.Barcode.dll to the folder bin of your web application the barcodes are needed for.
    2. Copy qrcode.aspx file to your web application.
  2. Add barcode library to your Visual Studio Toolbox.
    1. Open Toolbox in Visual Studio. Click menu View, and check submenu Toolbox.
    2. Right click Toolbox, click menu Choose Items...
    3. Goto .NET Framework Components tab.
    4. Check component QRCode7WebForm, and its namespace is BarcodeLib.Barcode.QRCode
    5. If no component found, click Browse... button and select BarcodeLib.Barcode.dll file.
  3. Now you can see the component displayed on Toolbox. You can drag QRCodeWebForm on your aspx page, change barcode setting through properties window.
6. How to Generate Barcode Image through Windows Controller in .NET?
  1. Add Reference BarcodeLib.Barcode.dll to your project. Do not copy the dll to the bin directory, Visual Studio will do so, during project compilation time.
    1. In your .NET windows project, right click mouse over Refereces in your Solution Explorer window. Then click menu "Add Reference ...".
    2. Add BarcodeLib.Barcode.dll to your project.
  2. Add barcode library to your Visual Studio Toolbox.
    1. Open Toolbox in Visual Studio. Click menu View, and check submenu Toolbox.
    2. Right click Toolbox, click menu Choose Items...
    3. Goto .NET Framework Components tab.
    4. Check component QRCodeWinForm, and its namespace is BarcodeLib.Barcode.QRCode
    5. If no component found, click Browse... button and select BarcodeLib.Barcode.dll file.
  3. Now you can see the component displayed on Toolbox. You can drag QRCodeWinForm on your form, change barcode setting through properties widnow.
7. How to Generate Barcode Image in .NET class?
  1. Add Reference BarcodeLib.Barcode.dll to your .NET project (ASP.NET website, Forms, any .NET project)
    In your .NET class.
    BarcodeLib.Barcode.QRCode.QRCode barcode = BarcodeLib.Barcode.QRCode.QRCode();
    barcode.Data = "your barcode data";
    // other barcode settings.
                            
    // save barcode image into your system
    barcode.drawBarcode("c:/barcode.gif");

* Please set properties UOB and Resolution, before you set any image size related properties like ModuleSize, LeftMargin.
8. How to Save Barcode Image?
In Windows Controller, just call method SaveAsImage(string filename). e.g. SaveAsImage("C:\barcode.gif");
9. Barcode Property Settings