C#. POSTNET Generator Data Encoding Tutorial
Sample source code to input valid data and generate linear POSTNET images in C# .NET
C# POSTNET Introduction
Postnet, also known as USPS POSTNET Barcode, USPS POSTal Numeric Encoding Technique Barcode, is a delivery point barcodes adopted by United States Postal Services.
C# POSTNET barcode is one function of OnBarcode��s Barcode for .NET generation control, which provides an easy way for creating POSTNET barcodes in Visual C#.NET programs by easily installing & integrating barcode POSTNET generation library SDK into C# developments. High-quality POSTNET barcodes to jpeg, gif, png, tiff, bitmap files in C# program.
This article provides a complete demo for POSTNET data encoding in Visual C#.NET class with C#.NET component.
OnBarcode C# Barcode Generator is designed to generate, create POSTNET and other linear & 2d barcodes in Microsoft Word.
Here are some more tutorials for C# POSTNET generation concerning size & image setting.
How to generate, print barcode using .NET, Java sdk library control with example project source code free download:
Encode POSTNET Valid Character in C#.NET
POSTNET is a numeric-only linear barcodes.
POSTNET valid character set:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Linear barcode = new Linear();
barcode.Type = BarcodeType.POSTNET;
barcode.Data = "978123456789";
barcode.BarcodeWidth = 200;
barcode.Format = ImageFormat.Png;
barcode.drawBarcode("c:/postnet.png");
Modify POSTNET Valid Length in C#.NET
POSTNET is a fixed-length linear barcode symblogy. It can be encoded into 5, 6, 9 or 11 digits with a check digit in the end.
Set POSTNET Barcodes in 5-digit length
A 5 digit (plus check digit) barcode, containing the basic ZIP Code only, referred to as the "A" code. 32 bars total.
Linear barcode = new Linear();
barcode.Type = BarcodeType.POSTNET;
barcode.Data = "12345";
barcode.BarcodeWidth = 200;
barcode.Format = ImageFormat.Png;
barcode.drawBarcode("c:/postnet.png");
Make POSTNET Barcodes in 6-digit length
A 6 digit (plus check digit) barcode, containing the last 2 digits of the ZIP Code and the 4 digits of the ZIP+4 Code, referred to as a "B" code. 37 bars total.
Linear barcode = new Linear();
barcode.Type = BarcodeType.POSTNET;
barcode.Data = "123456";
barcode.BarcodeWidth = 200;
barcode.Format = ImageFormat.Png;
barcode.drawBarcode("c:/postnet.png");
Print POSTNET Barcodes in 9-digit length
A 9 digit (plus check digit) barcode, containing the ZIP Code and ZIP+4 Code, referred to as the "C" code. 52 bars total.
Linear barcode = new Linear();
barcode.Type = BarcodeType.POSTNET;
barcode.Data = "123456789";
barcode.BarcodeWidth = 200;
barcode.Format = ImageFormat.Png;
barcode.drawBarcode("c:/postnet.png");
Generate POSTNET Barcodes in 11-digit length
An 11 digit (plus check digit) barcode, containing the ZIP Code, ZIP+4 Code, and the delivery point code. 62 bars total.
Linear barcode = new Linear();
barcode.Type = BarcodeType.POSTNET;
barcode.Data = "123456789012";
barcode.BarcodeWidth = 200;
barcode.Format = ImageFormat.Png;
barcode.drawBarcode("c:/postnet.png");