[]
IBarcode, IFontOption, ILabelOptionAn EAN-13 barcode consists of 12 numeric digits and 1 check digit. This interface provides access to barcode-specific options such as the add-on text and its label position, together with the common barcode, font, and label settings defined by IBarcode, IFontOption, and ILabelOption.
In the example below, cell A1 stores the 12-digit EAN-13 primary code, and "12" passed to the formula is the separate add-on text.
worksheet.getRange("A1").setValue("123456789012");
worksheet.getRange("B1").setFormula("=BC_EAN13(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",1,\"bottom\",\"12\",\"bottom\",,\"normal\",\"normal\",\"none\",\"center\",12,11,7,0,0)");
IEAN13 barcode = (IEAN13) worksheet.getRange("B1").getValue();
String primaryCode = barcode.getValue();
String addOn = barcode.getAddOn();
String addOnLabelPosition = barcode.getAddOnLabelPosition();
getAddOn()getBackgroundColor, getCodeType, getColor, getQuietZoneBottom, getQuietZoneLeft, getQuietZoneRight, getQuietZoneTop, getValuegetFontFamily, getFontSize, getFontStyle, getFontTextAlign, getFontTextDecoration, getFontWeightgetLabelPosition, getShowLabelThe add-on text is an optional supplemental code associated with the barcode. When present, its length is 2 or 5 characters.
In the example below, cell A1 provides the 12-digit primary code and "12" passed to the formula is the separate add-on text.
worksheet.getRange("A1").setValue("123456789012");
worksheet.getRange("B1").setFormula("=BC_EAN13(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",1,\"bottom\",\"12\",\"bottom\",,\"normal\",\"normal\",\"none\",\"center\",12,11,7,0,0)");
IEAN13 barcode = (IEAN13) worksheet.getRange("B1").getValue();
String primaryCode = barcode.getValue();
String addOn = barcode.getAddOn();
In the example below, cell A1 provides the 12-digit primary code and "12" passed to the formula is the separate add-on text.
worksheet.getRange("A1").setValue("123456789012");
worksheet.getRange("B1").setFormula("=BC_EAN13(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",1,\"bottom\",\"12\",\"bottom\",,\"normal\",\"normal\",\"none\",\"center\",12,11,7,0,0)");
IEAN13 barcode = (IEAN13) worksheet.getRange("B1").getValue();
String primaryCode = barcode.getValue();
String addOnLabelPosition = barcode.getAddOnLabelPosition();