EAN-13 C# Size Setting
|
EAN-13 ![]() |
W = ( 7C + 11 )X + 2Q |
W: width of EAN-13 barcode image (including quiet zones) X: width of EAN-13 narrowest bar; (X min = 1 pixel) C: the number of encoded data chars for EAN-13, including the check digit; C =12. Q: width of the quiet zone; Q > = 7X; Q (L) = 11X, Q (R) = 7X. For Avapose, default Q=10X. |
With the formula above, there will be three ways to set the size of a EAN-13 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-13 Generators will reset the barcode width to a minimum value according to the standard. Here is an example:
|
|
However, the W (200 pixel) you have set in C# generator is less than the minimum barcode width (230pixel), so the generator will automatically reset it to 230 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 270 pixel, which is larger than the minimum width, so an extra 20 pixel will be added to both side of the quiet zone. Here is the barcode image:
![]() |
EAN-13 barcode field configuration in C# for various barcode solutions