// generate linear barcode object
BarCode barcode = new BarCode();
// Set barcode type to EAN13
barcode.SymbologyType = SymbologyType.EAN13;
// Enter 12-digit data string
barcode.CodeText = "123456789123";
// set EAN13 barcode image settings
// Set bar width of EAN13
barcode.X = 2;
// set EAN13 barcode image
barcode.BarCodeWidth = 250;
barcode.BarCodeHeight = 90;
// save generated barcode images to png image file using C#
barcode.drawBarcode("C://kdean13.png");
' generate linear barcode object
Dim barcode As New BarCode()
' Set barcode type to EAN13
barcode.SymbologyType = SymbologyType.EAN13
' Enter 12-digit data string
barcode.CodeText = "123456789123"
' set EAN13 barcode image settings
' Set bar width of EAN13
barcode.X = 2
' set EAN13 barcode image
barcode.BarCodeWidth = 250
barcode.BarCodeHeight = 90
' save generated barcode images to png image file using VB.NET
barcode.drawBarcode("C://kdean13.png")
Barcode properties | HTTP Parameters | Default | Comments | |
---|---|---|---|---|
EAN13 specific properties | SymbologyType | symbology-type | Code128 | Type of barcode symbology. Set barcode type symbology to EAN 13 using the value:
|
CodeText | code-text | "123456789012" | The data message to be encoded into a barcode symbol Valid EAN 13 character set includes:
|
|
EnableChecksum | enable-checksum | true | Automatically add the checksun digit to a barcode if the value is set as True. EAN 13 has One checksum and the checksum property is always enabled to EAN 13 barcode |
|
SupplementData | supplement-data | "" | A supplement to EAN or UPC barcodes. There are commonly 2-Digit and 5-Digit supplements. To add the 2-Digit supplement or 5-Digit supplement to EAN-13:
|
|
SupplementSpace | supplement-space | 15 | Barcode supplementary space between main barcode and supplement barcode. only valid for EAN-8, EAN-13, UPC-A, UPC-E, ISBN, ISSN | |
Symbology properties | X | x | 2 | The width of narrow bars and the default value of X is 2 pixels.
You can increase the value of X to enhance the readability of the barcode if the barcode scanners could not read stably the barcode which is set as the default value in X dimension. |
Y | y | 75 | Height of a barcode module
The default bar height value is 75 pixels |
|
Resolution | resolution | 72 | This property set the resolution in DPI of a barcode image to be drawn, and the default value that is set to printer is 72 pixels. You can adjust the value to get a custom resolution barcode image. | |
GraphicsUnit | graphics-unit | GraphicsUnit.Pixel | This is the barcode graphic measurements for all size related settings. There are three type of measurements:
|
|
Rotate | rotate | 0 | The Rotate property allows you changing the angle of a barcode. The valid values are:
|
|
DisplayCodeText | display-code-text | true | The default value is true, which makes the encoded data message human readable. Otherwise the data message text will not be displayed on the barcode image | |
CodeTextFont | code-text-font | "Arial", Font.PLAIN, 11 | CodeTextFont property is used for changing the font style of data message text that can be read by human eyes. | |
Image properties | Format | format | ImageFormat.Png | This is a method that is used for exporting barcode to different type of image formats. It allows developers generate barcode in formats like JPEG/JPG, BMP, GIF, and PNG.
The default method is ImageFormat.Png. Image format type. Using System.Drawing.Imaging.ImageFormat |
LeftMargin | left-margin | 0 | The property to set the distance between the symbol and the left margin of a barcode image. | |
RightMargin | right-margin | 0 | The property to set the distance between the symbol and the right margin of a barcode image. | |
TopMargin | top-margin | 0 | The property to customize the space between the symbol and the top margin on a barcode image | |
BottomMargin | bottom-margin | 0 | The property to change the space between the symbol and the bottom margin on a barcode image |