.NET Code 39 Barcode Generator
How to create, generate, print barcode code 39 label using c#, vb.net in asp.net mvc, windows application with free example source code


How to generate, display, print code 39 barcode labels in asp.net mvc, windows, crystal reports, rdlc reports.



  • Strong-named assemblies written in C#.NET with full integration into .NET applications
  • Compatible with latest ISO/IEC specification for Code 39 for valid barcode output
  • Support generating and printing Code 39 barcode image with C#.NET & VB.NET programming
  • Draw and save Code 3 of 9 barcodes locally in Png, Jpeg, Gif, Tiff & Bmp/Bitmap image formats
  • Adjust bar width, bar height, color, human-readable text, orientation, resolution & check digit
  • High-quality Code 39 barcode image generation that supports all printers
.NET Code 39 Barcode Generator Overview
Code 39 Barcode Encoder Component SDK is a barcode functionality of KA.Barcode Generator for .NET Suite, which can efficiently add Code 39 generation features into various .NET projects like ASP.NET webform, windows applications, C#, VB.NET class & console applications, etc. Besides, the user-friendly interface provides easy customization for the generated barcode images.
Code 39 Introduction
Code 39, also named ANSI/AIM Code 39, ANSI/AIM Code 39, Uniform Symbology Specification Code 39, USS Code 39, USS 39, Code 3/9, Code 3 of 9, USD-3, LOGMARS, Alpha39, Code 39 Extended, and Code 39 Full ASCII, is a linear barcode widely used in non-retail environments.

c# qr code generator with logo, crystal reports barcode font formula, barcode scanner integration in asp.net, vb.net data matrix generator vb.net, scan barcode using camera c#, how to set barcode in rdlc report using c#
Code 39 Encodable Characters for .NET Suite
  • Alphanumeric data: 0-9, A-Z
  • Special characters: space $ % + - . /
  • Start/sop character *
  • Code 39Ex can encode all ASCII characters: 0-9, A-Z, a-z, and special characters
Download Code 39 Barcode DLL for .NET Suite
Above all, please KA.Barcode for .NET Suite and unzip it. You will find the following 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
How to Generate Code 39 Barcode in C# or VB.NET
Switch to the Visual Studio Solution Explorer window, and add "KeepAutomation.Barcode.Windows.dll" or "KeepAutomation.Barcode.Web.dll" as reference of the project. Then copy the following C# or VB.NET sample code to the page where the Code 39 is generated.
C# Sample code
     BarCode code39 = new BarCode();
code39.Symbology = KeepAutomation.Barcode.Symbology.Code39;
code39.CodeToEncode = "CODE39";
code39.generateBarcodeToImageFile("c://code39-csharp.tiff");

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

code39.Symbology = KeepAutomation.Barcode.Symbology.Code39
code39.CodeToEncode = "CODE39"
code39.generateBarcodeToImageFile("c:/code39-vbnet.tiff")

How to Generate Code 39 Barcode in ASP.NET Project
  1. Please download and unzip the trial package.
  2. Then, create a new ASP.NET project and copy "barcode.aspx" and "barcode.aspx.cs" to the newly created project.
  3. Next, add "KeepAutomation.Barcode.Web.dll" to your project reference.
  4. Drag and drop "BarCodeControl" in Toolbox to the aspx page where your Code 39 barcode image is to be generated.
  5. Choose Code39 barcode type through the Properties panel.
  6. Run you ASP.NET web project and your Code 39 barcode image is generated.
How to Generate Code 39 in Microsoft Internet Information Services (IIS)
  1. Copy the "barcode" folder from the unzipped folder to IIS web application folder.
  2. Create a new virtual directory named "barcode" and then restart IIS.
  3. Testing: open your web browser and navigate to "http://YourDomain:port/barcode/barcode.aspx?code-to-encode=CODE39&symbology=4" (symboloy: Code39 = 4, Code39ex = 5).
  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=CODE39&symbology=4"/>
  5. Change settings of your created Code 39 barcode image in the above url.
How to Generate Code 39 Barcode in .NET WinForms
  1. Create a WinForms project in your Visual Studio.
  2. Add reference (KeepAutomation.Barcode.Windows.dll) to your Visual Studio Toolbox.
  3. Drag and drop the BarCodeControl into the form.
  4. Switch to the Properties window and set "Symbology" property to "Code39".
  5. Finally, the Code 39 barcode image is created.
How to Generate Code 39 Barcode in .NET Reports

How to Create Code 39 Barcode Image in Crystal Reports
You are free to download and unzip this trial package to create Code 39 barcode image in Crystal Reports. A tutorial is offered to help you.
How to Create Code 39 Barcode Image in RDLC Reports
You are free to download and unzip this trial package to create Code 39 barcode image in RDLC Reports. A tutorial is offered to help you.
How to Create Code 39 Barcode Image in Reporting Services
You are free to download and unzip this trial package to create Code 39 barcode image in Reporting Services. A tutorial is offered to help you.
Code 39 Property Settings
Class Attribute HTTP Attribute Default Value Note
Basic
Symbology symbology Code128Auto Barcode symoblogy type
CodeToEncode code-to-encode "128" Barcode value to encode.
ChecksumEnabled checksum-enabled false ChecksumEnabled property is optional. Modulo 43 will be applied, if ChecksumEnabled property is true.
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.
Barcode Text Style
DisplayText display-text true Set to true, displaying barcode value text, otherwise do not display.
DisplayChecksum displace-checksum true Set to true, displaying barcode checksum digit, otherwise do not display.
TextFont text-font new Font(" Arial", 10 f, FontStyle.Regular) Barcode text font style.
TextMargin text-margin 6 Margin between barcode and text.
Code 39 Specific Settings
DisplayStarStop display-start-stop true Set to true, displaying Code 39 Start and Stop character (*).
I i 1.0f Code 39 inter-characters space. It抯 a multiple of X.
WideNarrowRatio wide-narrow-ratio 2.0f Code39 wide bar width vs narrow bar width ratio.
How to Generate Code 39 in .NET Applications with C#
To generate Code 39 linear barcode images in Visual C# class library, you only need to add this barcode control to your project reference at first, and then copy the following C# sample code to your barcoding project for a test! All Code 39 barcode settings below are adjustable.
C# Sample code
     BarCode code39 = new BarCode();
code39.Symbology = KeepAutomation.Barcode.Symbology.Code39;

//Code 39 Encodable Character Set: Alphanumeric data:
0-9, A-Z, space $ % + - . and Start/sop character *.

code39.CodeToEncode = "6663";

// Apply checksum for Code 39 barcode.
code39.ChecksumEnabled = true;
// Display Code 39 checksum in the human-readable text
code39.DisplayChecksum = true;

//Set Code 39 image size

// Code 39 unit of measure, Pixel, Cm and Inch supported.
code39.BarcodeUnit = BarcodeUnit.Pixel;
// Code 39 image resolution in DPI.
code39.DPI = 72;
// Code 39 module bar width, ie. Width of the narrowest bar (X dimention), default is 1 pixel.
code39.X = 3;
// Code 39 module bar height (Y dimention)
code39.Y = 60;
// Code 39 wide bar width vs narrow bar. Valid from 2.of-3.0f inclusive.
code39.WideNarrowRatio = 2.0f;
// Space between character symbol, a multiple of X.
code39.I = 1.0f;

// Left margin size, a 10X space is automatically added according to specification.
code39.LeftMargin = 0;
// Right margin size, a 10X space is automatically added according to specification.
code39.RightMargin = 0;
code39.TopMargin = 0;
code39.BottomMargin = 0;
// Code 39 image orientation: 0, 90, 180, 270 degrees supported
code39.Orientation = KeepAutomation.Barcode.Orientation.Degree0;

//Set Code 39 human readable text style

// Display human readable text
code39.DisplayText = true;
code39.TextFont = new Font("Arial", 10f, FontStyle.Regular);
// Space between barcode and text
code39.TextMargin = 6;
// Print Code 39 Start & Stop Char *in barcode text
code39.DisplayStartStop = true;
// Print Code 39 barcodes in Png, Jpeg, Gif, Tiff, Bmp, etc. image formats.
code39.ImageFormat = ImageFormat.Png;

// Generate and save Code 39 barcodes to image format
code39.generateBarcodeToImageFile("C://barcode-code39-csharp.gif");

/* Create Code 39 barcodes in Stream object
code39.generateBarcodeToStream(".NET System.IO.Stream Object");

Draw & Print Code 39 barcodes to Graphics object
code39.generateBarcodeToGraphics(".NET System.Drawing.Graphics Object");

Generate Code 39 barcodes & write to byte[]
byte[] barcodeInBytes = code39.generateBarcodeToByteArray();

Generate Code 39 barcodes & encode to System.Drawing.Bitmap object
Bitmap barcodeInBitmap = code39.generateBarcodeToBitmap();
*/
Code 39 Barcode Generation Using VB.NET Demo Code
After you download the trial version of this VB.NET barcode generator SDK and add reference to your barcode project, you may copy the following VB sample code to generate Code 39 barcode image. You can also customize the generated barcode image by resetting Code 39 parameters.
VB Sample code
     Dim code39 As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode
code39.Symbology = KeepAutomation.Barcode.Symbology.Code39
code39.CodeToEncode = "3939"

'Apply checksum for Code 39 barcode.
code39.ChecksumEnabled = True
'Display checksum in the Code 39 barcode text
code39.DisplayChecksum = True

'Unit of measure, Pixel, Cm and Inch supported.
code39.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel
'Code 39 image resolution in DPI.
code39.DPI = 72

'Set generated Code 39 image size

'Code 39 bar module width (X dimention)
code39.X = 1
code39.Y = 60
'Code 39 wide bar width vs narrow bar width. Valid from 2.0f to 3.0f.
code39.WideNarrowRatio = 2.0F
'Space between character symbol, a multiple of X.
code39.I = 1.0F


'Image left margin size, a 10X automatically added according to specification.
code39.LeftMargin = 0
'Image right margin size, a 10X automatically added according to specification.
code39.RightMargin = 0
'Code 39 image top margin size'
code39.TopMargin = 0
'Code 39 image bottom margin size'
code39.BottomMargin = 0

'Orientation, 90, 180, 270 degrees supported' Code 39 image bottom margin size

code39.Orientation = KeepAutomation.Barcode.Orientation.Degree0
'Code 39 image formats in Png, Gif, Jpeg/Jpg, Tiff, Bmp, etc.
code39.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif

'Set Code 39 human readable text style
code39.DisplayText = True
code39.TextFont = New Drawing.Font("Arial", 10.0F, Drawing.FontStyle.Regular)
'Space between barcode and text
code39.TextMargin = 6

'Print Code 39 Start & Stop character * in the barcode text
code39.DisplayStartStop = True

code39.generateBarcodeToImageFile("C://code39-vb-net.gif")
Free Trial DownloadC#/VB Code 39For Web Code 39For Windows Code 39For Reports Code 39Using C#Using VB.NETData Matrix for .NETPDF417 for .NETQR Code for .NETmoreCodabar 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.