VB.NET EAN-13 Generator Size Setting Tutorial

sample source code to generate linear EAN-13 images and adjust barcode size in VB.NET

  • VB.NET developer tool
  • Automatically calculate and generate the check digit in EAN-13
  • Add EAN-13 add-on symbol to EAN-13
  • Set the height of supplement bars based on the height of bars in main barcode
  • Easy to set the space between add-on symbol and main barcode
  • Create jpg, gif, png, tiff, bitmap
  • Generate EAN-13 supplement barcode with flexible size
  • Easy to set the space between main barcode and supplement barcode

EAN-13, also known as European Article Number 13, UPC-13, GTIN-13, GS1-13, EAN/UCC-13, is the standard barcode version of European Article Number.

How to generate, print barcode using .NET, Java sdk library control with example project source code free download:

EAN-13 Symbology Structure

W: the width of EAN-13 barcode image, including quiet zones, controlled by property BarCodeWidth

X (X ≥ 1 pixel): the width of EAN-13 narrowest bar, controlled by property X

C: the number of EAN-13 encoded data characters, including the check digit; C =12

Q (Q ≥ 10X): the width of the quiet zone, related to property LeftMargin & RightMargin

More information about EAN-13 barcode settings in VB.NET Barcode Generator,please see:


EAN-13 VB.NET Generator Size Setting Tutorial

After EAN-13 VB.NET Generator installation, get it ready in VB.NET by placing the following statement:

Dim ean13 As OnBarcode.Barcode.Linear

ean13 = New OnBarcode.Barcode.Linear

ean13.Type = OnBarcode.Barcode.BarcodeType.EAN13

If supplement barcode is needed, please select EAN13_2 or EAN13_5 instead of EAN13. Please remember to add string value to property SupData.

SupHeight & SupSpace

The height of the supplement barcode is controlled by property SupHeight (Type: Float; Default: 0.8).The space between the main barcode and the supplement barcode is set by property SupSpace (Float; Default: 15 pixels).

Sample usage:

ean13.SupHeight = 0.7

ean13.SupSpace = 10


UOM is the controller of size setting unit. Pixel, Cm, and Inch are provided as its options. The default value of UOM is Pixel. For example, type the following statement to select Pixel as the unit of size setting measure:

ean13.UOM = OnBarcode.Barcode.UnitOfMeasure.PIXEL

X & Y

Property X (Type: Float; Default: 1) and Property Y (Type: Float; Default: 60) are used in EAN-13 barcode symbol size setting. X is for the module width setting (supplement barcode included), and Y controls the height of the bar.

Sample usage:

ean13.X = 2

ean13.Y = 70

BarCodeHeight & BarCodeWidth

Property BarCodeHeight (Type: Float; Default: 0) and Property BarCodeWidth (Type: Float; Default: 0) to set the size of the whole image.

Sample usage:

ean13.BarcodeHeight = 60

ean13.BarcodeWidth = 175


When the value of X, Y, BarCodeWidth, and BarCodeHeight conflict with each other, Property AutoResize (Type: bool; Default: False) should be enabled to solve the problem and make the EAN-13 100% compatible with its symbology specification. See EAN-13 Barcode Size in VB.NET to know more usage of AutoResize.

Sample usage:

ean13.X = 2

ean13.BarcodeHeight = 60

ean13.AutoResize = True

TopMargin, BottomMargin, LeftMargin, & RightMargin

Using EAN-13 VB.NET Generator, a quiet zone with 10X width will be generated automatically at each side of the EAN-13. When wider quiet zone is needed, you can increase the value of properties LeftMargin (Type: Float; Default: 0) and RightMargin (Type: Float; Default: 0). You can also create margins using TopMargin (Type: Float; Default: 0) and BottomMargin (Type: Float; Default: 0).

Sample usage:

ean13.TopMargin = 10

ean13.BottomMargin = 10

ean13.LeftMargin = 10

ean13.RightMargin = 10


Human readable text are required in almost every linear barcode symbology. Property TextMargin (Type: Float; Default: 6 pixel) is used to set the space between EAN-13 bar code and the human readable text below the barcode.

Sample usage:

ean13.TextMargin = 10

OnBarcode is a market-leading provider of barcode imaging generator, reader controls and components for ASP.NET, Windows Forms, WPF, as well Java, Android, iOS (iPhone, iPad) across all major enterprise development platforms. We provides comprehensive tutorials and how-tos for various linear, 2d barcode information, such as C# in ASP.NET, C# .NET, C# Barcode Encoding, C# Barcode Image, VB.NET in ASP.NET, VB.NET Winforms, VB.NET Barcode Encoding. OnBarcode barcode products are supported by RasterEdge ASP.NET Document Viewer, which supports ASP.NET PDF Viewer, ASP.NET MVC Document Viewer, ASP.NET PDF Editor, MVC PDF Viewer. And provide high quality C# Convert PDF to Tiff, C# Convert PDF to Word, C# Convert PDF to HTML, C# Convert PDF to Jpeg images, and their easy and simple documents, like C# PDF SDK, C# extract text from PDF, C# Compress PDF, Print PDF in C# and C# extract image from PDF.
Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.