Generate Code 39 barcode images for .NET applications, like ASP.NET, Windows Forms, .NET Class Library & Console Application
Insert & add Code 39 barcode images in SQL Server Reporting Services applications (2005 & 2008)
Create & add Code 39 linear images in .NET Crystal Reports and Client RDLC Reports
Encode & save ISO/IEC compatible Code 39 barcodes in image files as well as byte stream objects
Support user-defined Code 39 image generation and adjustment in VB.NET programming
Support royalty free redistribution with the purchase of provided .NET developer license
This section provides an overview of generating Code 39 barcodes using the BarcodeLib SDK within VB.NET. Code 39 is a discrete, variable length symbology commonly referred to as "Code 3/9," "Code 3 of 9," "USS Code 39," "USD-3," "Alpha39," or "Type 39." The BarcodeLib VB.NET Code 39 Generator is designed for straightforward integration into Windows Forms (WinForms) and Windows Presentation Foundation (WPF) desktop applications, as well as class libraries and console projects.
VB.NET Linear Code 39 Barcode Introduction
In specific applications, 1D barcode Code 39 may be called Alpha39, Code 3 of 9, Code 3/9, Type 39, USS Code 39, or USD-3.
Barcode Standard Compatibility: Code 39 barcodes created by this VB.NET Barcode Generator Library is in accordance with ISO / IEC 16388 (2nd edition 2007-05-15) barcode specification.
In 1974, Dr. David Allais and Ray Stevens of Intermec created Code 39 barcode. Now, this linear barcode type is often used in Non-retail environments, U.S. Government and military use and Health Industry Bar Code Council (HIBCC)).
Code 39 has 43 encodable characters that includes A-Z, 0-9, 7 special chars [-(Dash), $(Dollar), %(Percentage), (Space), .(Point), /(Slash), +(Plus)], and 1 start/stop characters (*).
Using the BarcodeLib VB.NET Barcode Generator library, the following properties can be applied to customize Code 39 bar and space dimensions, as well as the display of start and stop characters within Visual Basic .NET applications:
ShowStartStopInText: Enables or disables the display of start/stop characters (*) in the Code 39 human readable text.
N: Defines the ratio of wide bar width to narrow bar width. Valid values range from 2.0 to 3.0 inclusive; the default is 2.0.
I: Specifies the space between two characters in Code 39. This value is a multiple of X (narrow bar width).
Show / hide Code 39 start/stop chars
You can choose to hide the start/stop characters (*) in the barcode text while still encoding them within the symbol. This is useful when a cleaner text label is desired in WinForms or WPF user interfaces.
Set the ShowStartStopInText property to False to hide the start/stop characters in the human readable text.
The N property controls the ratio between wide and narrow bar widths. Adjusting this ratio affects the visual appearance and scanning characteristics of the barcode.
Valid values for N are from 2 to 3 inclusive; the default is 2.
barcode.N=3
Code 39 Intercharacter space (I)
The I property defines the space between adjacent character modules. This space is expressed as a multiple of X (the narrow bar width).
The default value is 1.0f. Adjusting this value can help optimize barcode readability when printed on specific media.
barcode.I=2
How to Generate Code 39 Linear Barcode Using VB.NET Class Library?
How to Install
Add barcode dll component to your VB.NET project reference.
Click "Project" and select "Add Reference...".
Click "Browse" to find Barcodelib.Barcode.ASP.NET.dll or BarcodeLib.Barcode.WinForms.dll in the unzipped file, and click "OK" button.
Add BarcodeLib barcoding dlls to Visual Studio Toolbox.
Right click in Toolbox and select "Choose Items...".
In the pop-up "Choose Toolbox items" window, click "Browse..." to select either BarcodeLib.Barcode.WinFroms.dll or Barcodelib.Barcode.ASP.NET.dll.
Click "OK" and now four items are listed in VS Toolbox, for example: LinearWinForm, DataMatrixWinForm, PDF417WinForm, and QRCodeWinForm. And now it's done!
How to Generate Code 39 Bar Codes in VB.NET ASP.NET Web Applications?
To generate Code 39 barcodes in ASP.NET, you may follow the steps below (Two Methods Provided).
VB.NET Code 39 barcode generation through BarcodeLib Buildin ASP.NET Barcode Application.
Unzip the downloaded evaluation package, and copy barcode folder and its contents to your IIS folder, eg. C:\inetpub.
Create a new virtual directory in your IIS, name it "barcode", and connect it to the above "barcode" folder in inetpub.
Restart IIS for a Code 39 streaming test.Simply navigate to: http://YourDomain:port/barcode/linear.aspx?Type=7&Data=CODE39-99887766&LeftMargin=6&RightMargin=6 Above is the generated Code 39 barcode image. If you need to adjust other Code 39 dimensions, please view more web stream URL parameters for Code 39 here: .NET Code 39 Barcode Property Settings.
You can also insert this Code 39 image in your aspx or html page, simply pass the url to IMG tag or src value. For example: <img src=http://YourDomain:port/barcode/linear.aspx?Type=7&Data=CODE39-99887766&LeftMargin=6&RightMargin=6 /> This method will not generate any barcode images in your IIS server side.
VB.NET Code 39 barcodes encoding through ASP.NET Web Form Controller.
Intall ASP.NET barcode controller to your barcoding project by adding reference.
Add barcode library to your Visual Studio toolbox.
Open barcode in your unzipped trial package, and copy files "linear.aspx", "linear.aspx.cs" to the aspx page where you will be generating Code 39 images.
Now you can drag LinearASPNET to your ASP.NET web site, and change Code 39 settings through properties window on the right.
Run the project and a Code 39 barcode is generated on your aspx pages.
Or you may directly generate Code 39 barcodes using above free sample VB.NET code for your ASP.NET applications.
How to Create Linear Code 39 Images in VB.NET Windows Applications?
Add reference to BarcodeLib.Barcode.WinForms.dll to your barcoding project.
BarcodeLib.Barcode.WinForms.dll to your Visual Studio toolbox.
You can simply drag the LinearWinForm to your windows form, and a Code 39 barcode is generated.
Or you may directly create Code 39 barcodes using above free sample VB.NET code for your .NET Windows Forms applications.
Summary
This guide has outlined the process of generating Code 39 barcodes using the BarcodeLib SDK in VB.NET, with particular attention to customization options such as bar width ratios, intercharacter spacing, and start/stop character display. These features are well suited for integration into Windows Forms (WinForms) and Windows Presentation Foundation (WPF) desktop applications, enabling developers to tailor barcode appearance to specific design and printing requirements. By following the examples and explanations provided, you can effectively incorporate Code 39 generation into your VB.NET projects.
VB.NET Barcode Generator Control Supporting Symbologies