.NET Barcode for WinForms          ASP.NET Barcode          .NET Barcode Reader          Java Barcode          Java Barcode Reader
Home > C#.NET Barcode Generator > Generating Linear Barcodes in C# - POSTNET

C# Barcode Generator for Postnet Creation

How to generate and print USPS Postnet barcode for .NET application using C# barcode SDK

  Install and register C# barcode DLL for .NET projects in Visual Studio

    See Barcode Generator Installation in C#.NET in Visual Studio 2005/2008/2010

  Create USPS Postnet barcode image using C# barcode making SDK

Avapose .NET Barcode Generator generates 23 linear barcode symbologies. Find the properties “Symbology” (default value: Code128Auto) in Properties Windows, and input the symbology value you want according to the following list:

Symbology Value Symbology Sample Code in C#
POSTNET POSTNET


BarCode
barcode = new BarCode();
barcode.Symbology = Symbology.Postnet;



Postnet barcode data encoding using C# barcode generating component

Find the properties “Data” (default value: 128) in Properties Windows. Input the data you are going to encode in the POSTNET. Make sure the data you input is within the character set of POSTNET.

Symbology Value Symbology Character Set Input Digits Account
POSTNET


Numeric Character: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9;

5,6,9,11


C# code of encoding data to Postnet barcode using C# barcode creating API

Property Name Sample Code
Data


BarCode
barcode = new BarCode();
barcode.Symbology = Symbology.Postnet;
barcode.Data = "98765432109";



Postnet barcode size properties and methods using C# barcode generator

Size Setting of the barcode provided by Avapose .NET Barcode Generator is comprehensive.

We can generally divide it into four parts:

1. Unit Of Measure Setting

2. Image Size Setting : BarcodeImageWidth and BarcodeImageHeight

3. Module Size Setting: X and Y

4. Margin Size Setting: MarginTop, MarginBottom, MarginLeft, and MarginRight

Property Value Type Default Value Property Description Sample Code
UOM UnitOfMeasure Pixel
The unit of measure;

Options:

Pixel
Cm
Inch

BarCode barcode = new BarCode(); barcode.Symbology = Symbology.Postnet;
barcode.Data = "98765432109";
barcode.UOM = UnitOfMeasure.Cm;
BarcodeImageWidth float 0 Barcode image width


BarCode
barcode = new BarCode(); barcode.Symbology = Symbology.Postnet;
barcode.Data = "98765432109";
barcode.BarcodeImageWidth = 175;

BarcodeImageHeight float 0 Barcode image height


BarCode
barcode = new BarCode();
barcode.Symbology = Symbology.Postnet;
barcode.Data = "98765432109";
barcode.BarcodeImageHeight =50;

X float 2 Width of module in unit of measure


BarCode
barcode = new BarCode(); barcode.Symbology = Symbology.Postnet; barcode.Data = "98765432109";
barcode.X = 1;

Y float 75 Height of module in unit of measure


BarCode
barcode = new BarCode(); barcode.Symbology = Symbology.Postnet; barcode.Data = "98765432109";
barcode.Y = 50;

AutoResize bool false -


BarCode
barcode = new BarCode(); barcode.Symbology = Symbology.Postnet; barcode.Data = "98765432109";
barcode.AutoResize = true;

MarginTop float 0 Top margin width of the barcode image in unit of measure
BarCode barcode = new BarCode(); barcode.Symbology = Symbology.Postnet; barcode.Data = "98765432109";
barcode.MarginTop = 5;
barcode.MarginBottom = 5;
barcode.MarginLeft = 5;
barcode.MarginRight = 5;
MarginBottom float 0 Bottom margin width of the barcode image in unit of measure
MarginLeft float 0 Left margin width of the barcode image in unit of measure
MarginRight float 0 Right margin width of the barcode image in unit of measure

POSTNET advanced barcode properties using C# barcode library

POSTNET Short Bar and Tall Bar Setting

Unlike EAN/UPC or Code 128, POSTNET has short bars and tall bars. The ratio of the short bar to tall bars is defined by property ShortTallRatio. ShortTallRatio = short bar height / tall bar height.



Property Value Type Default Value Property Description Sample Code
ShortTallRatio float 0.4f ShortTallRatio = short bar height / tall bar height

BarCode barcode = new BarCode();
barcode.Symbology = Symbology.Postnet;
barcode.ShortTallRatio = 0.6f; 



Related USPS POSTNET Barcode Integration & Generation Information

The following USPS POSTNET barcode integration and creation information links relate to this product that may be of interest to you: