VB.NET Code 39 Generator Data Encoding Tutorial
sample source code to input valid data and generate linear Code 39 images in VB.NET
Setup Code 39 VB.NET Generator
Code 39,
also known as Alpha39, Code 3 of 9, Code 3/9, Type 39, USS Code 39, or USD-3, is the first alpha-numeric linear barcode symbology used world-wide.
How to generate, print barcode using .NET, Java sdk library control with example project source code free download:
OnBarcode.com provides more details about how to set Code 39 barcode size and image in Barcode Generator Control on VB.NET:
Code 39 VB.NET Generator installation
1. Download the trial package and unzip
2. Copy OnBarcode.Barcode.WinForms.dll to your .NET project folder
3. Do not copy dll to .NET bin directory, .NET build tools will do it for you.
4. Add OnBarcode.Barcode.WinForms.dll to .NET project reference
5. Right click .NET Visual Studio Toolbox, select menu Choose Items...
6. In "Choose Toolbox Items" form, click button "Browse...", and select OnBarcode.Barcode.WinForms.dll
7. After selection, you will find four items under "Components" section: LinearWinForm, DataMatrixWinForm, PDF417WinForm, and QRCodeWinForm
After, get it ready in VB.NET by placing the following statement where Code 39 VB.NET Generator is needed:
Dim code39 As OnBarcode.Barcode.Linear
code39 = New OnBarcode.Barcode.Linear
code39.Type = OnBarcode.Barcode.BarcodeType.CODE39
Select Data for Code 39 VB.NET Generator
There are three code sets of Code 39. They are code set A, code set B, and code set C. Code 39 in different code set encodes different types of data character.
Generate Code 39 with Numeric Character
Code 39 is capable of encoding number 0 to 9.
Sample Usage:
Dim code39 As OnBarcode.Barcode.Linear = New OnBarcode.Barcode.Linear
code39.Type = OnBarcode.Barcode.BarcodeType.CODE39
code39.Data = "123"
Generate Code 39 using Uppercase Letters
Code 39 encodes uppercase letters A-Z.
Sample Usage:
Dim code39 As OnBarcode.Barcode.Linear = New OnBarcode.Barcode.Linear
code39.Type = OnBarcode.Barcode.BarcodeType.CODE39
code39.Data = "ABC"
Make Code 39 using using Punctuations
Code 39 encodes - (Dash),. (Point), $ (Dollar), / (Slash), + (Plus) % (Percentage), and (Space).
Sample Usage:
Dim code39 As OnBarcode.Barcode.Linear = New OnBarcode.Barcode.Linear
code39.Type = OnBarcode.Barcode.BarcodeType.CODE39
code39.Data = "+-"
Process Tilde in Code 39
If you want to use the tilde character "~" to specify special characters in the input data, please set property ProcessTilde to be true.
1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255); ASCII character '~' is presented by ~126 Strings from "~256" to "~299" are unused
2- byte character (Unicode): ~6ddddd (character value from 00000 ~ 65535) Strings from "~665536" to "~699999" are unused
Sample Usage:
code39.ProcessTilde = True
Valid length for Data in Code 39 VB.NET Generator
Code 39 Data Length
Code 39 is variable length symbology, which easily encodes data at any length.
Data Length in Code 39 VB.NET Generator
The value of property Data, which is used to define the data in Code 39, is a string value. You can input data at any length in the string.
Sample Usage:
Dim code39 As OnBarcode.Barcode.Linear = New OnBarcode.Barcode.Linear
code39.Type = OnBarcode.Barcode.BarcodeType.CODE39
code39.Data = "1"
Sample Usage:
Dim code39 As OnBarcode.Barcode.Linear = New OnBarcode.Barcode.Linear
code39.Type = OnBarcode.Barcode.BarcodeType.CODE39
code39.Data = "12345678"