.NET QR Code Generator Library
How to create, make, generate QR Code using C#, vb.net in asp.net mvc with free c# open source example code


Free C#, VB.NET example code to use .net qr code generator library in asp.net mvc, crystal reports, ssrs reports.



  • Mature and reliable matrix QR Code barcode control dll used world-wide
  • Fully integrate with Microsoft Visual Studio 2005/2008/2010 & .NET Framework versions
  • Accurate 2D QR Code generation dll compatible with ISO / IEC 18004 (2nd edition 2006-09-01)
  • Generate dynamic 2D QR Code in ASP.NET, .NET WinForms, IIS and Reporting Services
  • Draw and print QR Code barcode as graphic image without using barcode fonts
  • Support customizing generated QR Code barcodes using C# and VB.NET class
  • Royalty-free and perpetual licenses provided to this .NET Barcode Generator Suite
.NET QR Code Barcode Generator Overview
As a professional barcode generator control SDK library, KA.Barcode for .NET Suite includes complete and strong functionality for high-quality QR Code encoding and printing in types of .NET projects, such as ASP.NET web forms, windows applications, C#, VB.NET class, .NET console applications, Crystal Reports, RDLC Reports & SSRS. This page is a detailed guide that allows developers to know how to add high quality QR Code in .NET environment projects and resize barcode image.
2D QR Code Barcode Introduction
QR Code, also known as Denso Barcode, QRCode, Quick Response Code, JIS X 0510, ISO/IEC18004, is a kind of 2-D symbol which can be easily interpreted by scanner equipment. However, unlike other 1D or 2D barcode, QR code has higher reliabilities, higher speed scanning and smaller printout size.
Download QR Code Barcode Generator for .NET
The free trial package of KA.Barcode for .NET Suite contains three folders (barcode, Buy Now, Help and License) and the following eight dlls:
  • KeepAutomation.Barcode.Crystal.dll
  • KeepAutomation.Barcode.RDLC.dll
  • KeepAutomation.Barcode.SSRS2005.dll
  • KeepAutomation.Barcode.SSRS2005CRI.dll
  • KeepAutomation.Barcode.SSRS2008.dll
  • KeepAutomation.Barcode.SSRS2008CRI.dll
  • KeepAutomation.Barcode.Web.dll
  • KeepAutomation.Barcode.Windows.dll
You can use this trial version for an unlimited period of time on your computer. But it cannot be used for business applications for a "KA Barcode" watermark will appear on the resulting barcode randomly.
How to Generate QR Code Using C#.NET, VB.NET
You can generate QR Code barcode in .NET projects using C# or VB class by adding reference ("KeepAutomation.Barcode.Windows.dll" or "KeepAutomation.Barcode.Web.dll") to your Visual Studio project and compiling the following C# and VB sample codes.
C# Sample code
     using KeepAutomation.Barcode.Bean;

BarCode qrcode = new BarCode();
qrcode.Symbology = KeepAutomation.Barcode.Symbology.QRCode;
qrcode.QRCodeVersion = KeepAutomation.Barcode.QRCodeVersion.V10;
qrcode.QRCodeECL = KeepAutomation.Barcode.QRCodeECL.M;
qrcode.CodeToEncode = "0123456789";
qrcode.X = 3;
qrcode.Y = 3;
qrcode.TopMargin = 12;
qrcode.BottomMargin = 12;
qrcode.LeftMargin = 12;
qrcode.RightMargin = 12;
qrcode.QRCodeDataMode = KeepAutomation.Barcode.QRCodeDataMode.Auto;
qrcode.generateBarcodeToImageFile("c://qrcode-csharp.png");

VB Sample code
     Dim qrcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

qrcode.Symbology = KeepAutomation.Barcode.Symbology.QRCode
qrcode.QRCodeVersion = KeepAutomation.Barcode.QRCodeVersion.V10
qrcode.QRCodeECL = KeepAutomation.Barcode.QRCodeECL.M
qrcode.CodeToEncode = "0123456789"
qrcode.X = 3
qrcode.Y = 3
qrcode.TopMargin = 12
qrcode.BottomMargin = 12
qrcode.LeftMargin = 12
qrcode.RightMargin = 12
qrcode.generateBarcodeToImageFile("c:/qrcode-vbnet.png")

How to Generate QR Code Barcode in ASP.NET Project
It is able to generate professional QR Code barcode in ASP.NET web forms with this .NET Barcode Generator.
  1. Download the evaluation package and unzip it.
  2. Simply create a new ASP.NET project and copy "barcode.aspx" and "barcode.aspx.cs" to the project.
  3. Add "KeepAutomation.Barcode.Web.dll" to your project reference.
  4. Drag and drop "BarCodeControl" in Toolbox to the aspx page where your QR Code barcode image is to be generated.
  5. Select QR Code barcode type through the Properties panel.
  6. Run you ASP.NET web project to generate your QR Code barcode image.
You can also generate QR Code barcode image in IIS.
  1. Copy the "barcode" folder and its contents in the downloaded and unzipped package to your IIS.
  2. Create a new virtual directory named "barcode" and then restart IIS.
  3. Restart your IIS and navigate to
    "http://YourDomain:port/barcode/barcode.aspx?code-to-encode=qrcode&symbology=103"
  4. Add the image tag into target pages to insert barcodes in html or aspx pages:
    <img src="http://YourDomain:port/barcode/barcode.aspx?code-to-encode=qrcode&symbology=103"/>
  5. You can also change settings of your created QR Code barcode image in the above url.
How to Generate QR Code Barcode in .NET WinForms
You can also insert QR Code barcode image into .NET Windows Forms.
  1. First of all, you need to create a WinForms project in your Visual Studio.
  2. Then, you should add reference (KeepAutomation.Barcode.Windows.dll) to your Visual Studio Toolbox.
  3. Next, you may drag and drop the BarCodeControl into the form.
  4. After that, you can switch to the Properties window and set "Symbology" property to "QRCode".
  5. Finally, you will see the generated QR Code barcode image.
How to Generate QR Code Barcode in .NET Reports

QR Code Barcode Creation in Crystal Reports
It is simple to create high-quality QR Code barcode image in Crystal Reports with detailed developer guide.
QR Code Barcode Creation in RDLC Reports
It is simple to create high-quality QR Code barcode image in RDLC Reports with detailed developer guide.
QR Code Barcode Creation in Reporting Services
It is simple to create high-quality QR Code barcode image in Reporting Services with detailed developer guide.
QR Code Property Settings
Class Attribute HTTP Attribute Default Value Note
Basic
Symbology symbology Code128Auto Barcode symoblogy type.
QR Code is KeepAutomation.Barcode.Symbology.QRCode
CodeToEncode code-to-encode "128" Barcode data to encode.
ChecksumEnabled checksum-enabled false It is not applied for QR Code.
ImageFormat image-format ImageFormat.Png Barcode encoded image format.
Barcode Size
AutoSizeAdjust auto-size-adjust false If true, barcode X, Y module will be auto-adjusted.
BarcodeUnit barcode-unit BarcodeUnit.Pixel Unit of measure for all size related settings. 0: pixel; 1: inch; 2: cm.
X x 1 Barcode module width (narrow bar).
Y y 50 Linear barcode bar height / 2D barcode module height.
LeftMargin left-margin 0 Barcode image left margin.
RightMargin right-margin 0 Barcode image right margin.
TopMargin top-margin 0 Barcode image top margin.
BottomMargin bottom-margin 0 Barcode image bottom margin.
DPI dpi 72 Barcode image resolution in dpi.
Orientation orientation Orientation.Degree0 Barcode rotation angle.
BarCodeWidth barcode-width 0 Whole barcode width.
BarCodeHeight barcode-height 0 Whole barcode height.
2D / Matrix Group Barcode Properties
GroupEnabled group-enabled false Set to enable Data Matrix, PDF417, or QR Code group function.
GroupItemCount group-item-count 0 Data Matrix, PDF417, or QR Code group count.
GroupItemId group-item-id 0 Data Matrix, PDF417, or QR Code group item id.
GroupId group-item-id 0 Data Matrix, PDF417, or QR Code group item.
QR Code Specific Settings
FNC1 fnc1 FNC1.None To encode GS1 compatible QR Code, you need set value to "FNC1.First"
QRCodeDataMode qrcode-data-mode QRCodeDataMode.Auto Set QR Code data encoding mode.
  • QRCodeDataMode.Auto: It allows encoding all 256 possible 8-bit byte values. This includes all ASCII characters value from 0 to 127 inclusive and provides for international character set support

  • QRCodeDataMode.AlphaNumeric: It allows encoding alphanumeric data (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : ).Web Stream URL Parameter: Encoding. Valid values are: 0 (Auto), 1 (AlphaNumeric), 2 (Byte), 3 (Numeric), 4 (Kanji).

  • QRCodeDataMode.Byte: It allows encoding byte data (default: ISO/IEC 8859-1).

  • QRCodeDataMode.Numeric: It allows encoding numeric data (digits 0 - 9).

  • QRCodeDataMode.Kanji: It allows encoding Kanji characters.
QRCodeECL qrcode-ecl QRCodeECL.L Set QR Code error correction level, including L, M, Q, H.
QRCodeVersion qrcode-version QRCodeVersion.V1 Set QR Code version, from V1 to V40.
QRCodeECI qrcode-eci 3 QR Code column Extended Channel Interpretations. Valid values are from 000000 to 999999.
TildeEnabled tilde-enabled false Set TildeEnabled to true, specifying special characters in barcode data.

Support escape '~' for data message
  • 1-byte character: ~ddd (character value from 0 ~ 255)
    ASCII (with EXT): from ~000 to ~255

    For example, ASCII char [GS] is non-printable, and its decimal value is 29. In barcode data, you need use ~029 for char [GS].

  • 2-byte character: ~6ddddd (character value from 0 ~ 65535)

  • Unicode: from ~600000 to ~665535

  • ECI: from ~7000000 to ~7999999

  • SJIS: from ~9ddddd (Shift JIS 0x8140 ~ 0x9FFC and 0xE040 ~ 0xEBBF)
Free Trial DownloadC#/VB QR CodeFor Web QR CodeFor Windows QR CodeFor Reports QR CodeUsing C#Using VB.NETData Matrix for .NETPDF417 for .NETmoreCodabar for .NETCode 39 for .NETCode 128 for .NETEAN-8 for .NETEAN-13 for .NETEAN 128 for .NETIntelligent Mail for .NETInterleaved 2 of 5 for .NETISBN for .NETITF-14 for .NETRM4SCC for .NETUPC-A for .NETUPC-E for .NETmore
KeepAutomation provides complete barcode automation solutions. We recommend the customers use high quality document controls: ASP.NET Document Viewer, ASP.NET MVC Document Viewer, Document Viewer ASP.NET C#, ASP.NET PDF Viewer, ASP.NET Word Viewer, ASP.NET Excel Viewer, ASP.NET PDF Editor, MVC PDF Viewer, ASP.NET Annotate PDF, c# pdf sdk, C# View, edit PDF online , C# Convert PDF to Tiff, C# Convert PDF to text, txt, .net imaging sdk, C# PDF metadata edit from RasterEdge.com.