BarcodeGenerator

BarcodeGenerator class

BarcodeGenerator for backend barcode images generation. supported symbologies: 1D: Codabar, Code11, Code128, Code39Standard, Code39Extended Code93Standard, Code93Extended, EAN13, EAN8, Interleaved2of5, MSI, Standard2of5, UPCA, UPCE, ISBN, GS1Code128, Postnet, Planet EAN14, SCC14, SSCC18, ITF14, SingaporePost … 2D: Aztec, DataMatrix, PDf417, QR code …

new BarcodeGenerator(encodeType, codeText)

BarcodeGenerator constructor.

ParameterDescription
encodeTypeBarcode symbology type. Use EncodeTypes class to setup a symbology
codeTextText to be encoded.

Throws: BarcodeException

Example:

// This sample shows how to create and save a barcode image.
let encode_type = EncodeTypes.CODE_128;
let generator = new BarcodeGenerator(encode_type);
generator.setCodeText("123ABC");

Methods

NameDescription
importFromXml(filePath) (static)Imports BarCode properties from the xml-file specified and creates BarcodeGenerator instance.
exportToXml(filePath)Exports BarCode properties to the xml file specified
generateBarCodeImage(format)Generate the barcode image under current settings. This sample shows how to create and save a barcode image.
getBarcodeType()Barcode symbology type.
getCodeText()Text to be encoded.
getParameters()Generation parameters.
save(filePath, format)Save barcode image to specific file in specific format.
setBarcodeType()Barcode symbology type.
setCodeText(codeText, encoding, insertBOM)Encodes the Unicode codeText into a byte sequence using the specified encoding . UTF-8 is the most commonly used en