EAN-8 C# Size Setting
|
EAN-8 ![]() |
W = ( 7C + 11 )X + 2Q |
X: width of a narrow element C: number of encoded data chars (check digit included if used) N: wide/narrow bar ratio (2<=N<=3) Q: width of the quiet zone (Qmin=10X) W: barcode width of EAN-8 |
With the formula above, there will be three ways to set the size of a EAN-8 image in C#. Here are the methods and respective examples.
Method 1. Setting the X Dimension
Steps:
|
|
Method 2. Setting the Barcode Width
Steps:
|
|
Method 3. Setting both X Dimension and Symbol Width
Steps:
|
|
Attention: Please note that once you have set an X dimension, there will always be a minimum barcode width as calculated from the calculation above. Therefore, if the W you have set is less than the minimum value, Avapose EAN-8 Generators will reset the barcode width to a minimum value according to the standard. Here is an example:
|
|
However, the W (140 pixel) you have set in C# generator is less than the minimum barcode width (174pixel), so the generator will automatically reset it to 174 pixel according to standard. Here is the generated barcode image:
![]() |
On the other hand, if you set a barcode width larger than the minimum W calculated by the formula, extra spaces will be added to either side of the quiet zones.
|
|
Now your W setting is 200 pixel, which is larger than the minimum width, so an extra 13 pixel will be added to both side of the quiet zone. Here is the barcode image:
![]() |
EAN-8 barcode size custom in C# for various barcode solutions