Setting Intelligent Mail Barcode Size in C#
Generating and Printing Intelligent Mail Barcodes
OnBarcode provides comprehensive Intelligent Mail generators and scanner components for Java, .NET, Android, iOS developments and several reporting applications.
How to generate, print barcode using .NET, Java sdk library control with example project source code free download:
Intelligent Mail Structure
- W : the symbol width of Intelligent Mail
- Q : the width of the quiet zone
- X : the width of a module bar (Xmin=0.015 inch)
Setting Intelligent Mail Barcode Size in C#
Basic information you should know
For OnBarcode Intelligent Mail barcode, the width W of an Intelligent Mail symbol, including quiet zones, can be calculated from the following expression:
W = 149X
Three Situations for Setting Intelligent Mail Barcode Size in C#
Setting Intelligent Mail barcode size in C# Intelligent Mail Generator may have three situations:
Situation 1:
If you want to create an Intelligent Mail with a minimum X, please do as below:
- Set the minimum value of X.
- Set the AutoResize option to be false.
- Customize other properties.
Eg1. Set in C# Intelligent Mail generator:
code39.X = 2;
code39.AutoResize = false;
Other properties: default;
The generated Intelligent Mail image is:
Situation 2:
If you want to generate an Intelligent Mail with a fixed barcode image width (W), and try to draw maximum barcode module (X) as possible, please do as follows:
- Set the fixed value of barcode image width (W).
- Set the AutoResize option to be true.
- Customize other properties.
Eg2. Set in C# Intelligent Mail generator:
code39.BarcodeWidth = 500;
code39.AutoResize = true;
Other properties: default;
The generated Intelligent Mail image is:
In the above Intelligent Mail image, the bar module (X) is 3 pixel, which is the maximum bar module.
Situation 3:
If you want to generate a Intelligent Mail with minimum X and fixed barcode image width (W), please do as below:
- Set the values of minimum X and barcode image width (W).
- Set the AutoResize option to be false.
- Customize other properties.
Eg3. Set in C# Intelligent Mail generator:
code39.X = 1;
code39.BarcodeWidth = 200;
code39.AutoResize = false;
Other properties: default;
The generated Intelligent Mail image is:
Note that, once you have set bar module (X) value, there will be a minimum barcode image width defined by Intelligent Mail USPS specification.
Intelligent Mail minimum barcode image width (W min) is:
= 149X
So if your BarcodeWidth value is less than the minimum barcode width, the barcode generator component will reset BarcodeWidth value to the minimum barcode width value.
For example, you set:
code39.X = 3;
code39.BarcodeWidth = 200;
code39.AutoResize = false;
Other properties: default;
Then Intelligent Mail barcode minimum width (W min) is:
=149*3
= 447 pixel
Now your BarcodeWidth setting is 200 pixel, which is less than the minimum barcode width, the component generated Intelligent Mail image will be like this.
If your BarcodeWidth setting is 520 pixel, which is larger than the minimum barcode width (447 pixel), the generated Intelligent Mail image will be like below. And extra 36/37 pixel space has been added to the left and right side of barcode image.