Aspose.Barcode for Python via Java Generation and Recognition API docs
MaxiCodeMode Class Reference

Encoding mode for MaxiCode barcodes. More...

Inherits Enum.

Static Public Attributes

int MODE_2 = 2
 Mode 2 encodes postal information in first message and data in second message. More...
 
int MODE_3 = 3
 Mode 3 encodes postal information in first message and data in second message. More...
 
int MODE_4 = 4
 Mode 4 encodes data in first and second message, with short ECC correction. More...
 
int MODE_5 = 5
 Mode 5 encodes data in first and second message, with long ECC correction. More...
 
int MODE_6 = 6
 Mode 6 encodes data in first and second message, with short ECC correction. More...
 

Detailed Description

Encoding mode for MaxiCode barcodes.

This sample shows how to genereate MaxiCode barcodes using ComplexBarcodeGenerator

# Mode 2 with standard second message
maxiCodeCodetext = ComplexBarcode.MaxiCodeCodetextMode2()
maxiCodeCodetext.setPostalCode("524032140")
maxiCodeCodetext.setCountryCode(560)
maxiCodeCodetext.setServiceCategory(999)
maxiCodeStandartSecondMessage = ComplexBarcode.MaxiCodeStandartSecondMessage()
maxiCodeStandartSecondMessage.setMessage("Test message")
maxiCodeCodetext.setSecondMessage(maxiCodeStandartSecondMessage)
complexGenerator = ComplexBarcode.ComplexBarcodeGenerator(maxiCodeCodetext)
complexGenerator.generateBarCodeImage()
# Mode 2 with structured second message
maxiCodeCodetext = ComplexBarcode.MaxiCodeCodetextMode2()
maxiCodeCodetext.setPostalCode("524032140")
maxiCodeCodetext.setCountryCode(560)
maxiCodeCodetext.setServiceCategory(999)
maxiCodeStructuredSecondMessage = ComplexBarcode.MaxiCodeStructuredSecondMessage()
maxiCodeStructuredSecondMessage.add("634 ALPHA DRIVE")
maxiCodeStructuredSecondMessage.add("PITTSBURGH")
maxiCodeStructuredSecondMessage.add("PA")
maxiCodeStructuredSecondMessage.setYear(99)
maxiCodeCodetext.setSecondMessage(maxiCodeStructuredSecondMessage)
complexGenerator = ComplexBarcode.ComplexBarcodeGenerator(maxiCodeCodetext)
complexGenerator.generateBarCodeImage()
# Mode 3 with standart second message
maxiCodeCodetext = ComplexBarcode.MaxiCodeCodetextMode3()
maxiCodeCodetext.setPostalCode("B1050")
maxiCodeCodetext.setCountryCode(560)
maxiCodeCodetext.setServiceCategory(999)
maxiCodeStandartSecondMessage = ComplexBarcode.MaxiCodeStandartSecondMessage()
maxiCodeStandartSecondMessage.setMessage("Test message")
maxiCodeCodetext.setSecondMessage(maxiCodeStandartSecondMessage)
complexGenerator = ComplexBarcode.ComplexBarcodeGenerator(maxiCodeCodetext)
complexGenerator.generateBarCodeImage()
maxiCodeCodetext = ComplexBarcode.MaxiCodeCodetextMode3()
maxiCodeCodetext.setPostalCode("B1050")
maxiCodeCodetext.setCountryCode(560)
maxiCodeCodetext.setServiceCategory(999)
maxiCodeStructuredSecondMessage = ComplexBarcode.MaxiCodeStructuredSecondMessage()
maxiCodeStructuredSecondMessage.add("634 ALPHA DRIVE")
maxiCodeStructuredSecondMessage.add("PITTSBURGH")
maxiCodeStructuredSecondMessage.add("PA")
maxiCodeStructuredSecondMessage.setYear(99)
maxiCodeCodetext.setSecondMessage(maxiCodeStructuredSecondMessage)
complexGenerator = ComplexBarcode.ComplexBarcodeGenerator(maxiCodeCodetext)
complexGenerator.generateBarCodeImage()
# Mode 4
maxiCodeCodetext = ComplexBarcode.MaxiCodeStandardCodetext()
maxiCodeCodetext.setMode(Generation.MaxiCodeMode.MODE_4)
maxiCodeCodetext.setMessage("Test message")
complexGenerator = ComplexBarcode.ComplexBarcodeGenerator(maxiCodeCodetext)
complexGenerator.generateBarCodeImage()
# Mode 5
maxiCodeCodetext = ComplexBarcode.MaxiCodeStandardCodetext()
maxiCodeCodetext.setMode(Generation.MaxiCodeMode.MODE_5)
maxiCodeCodetext.setMessage("Test message")
complexGenerator = ComplexBarcode.ComplexBarcodeGenerator(maxiCodeCodetext)
complexGenerator.generateBarCodeImage()
# Mode 6
maxiCodeCodetext = ComplexBarcode.MaxiCodeStandardCodetext()
maxiCodeCodetext.setMode(Generation.MaxiCodeMode.MODE_6)
maxiCodeCodetext.setMessage("Test message")
complexGenerator = ComplexBarcode.ComplexBarcodeGenerator(maxiCodeCodetext)
complexGenerator.generateBarCodeImage()

Member Data Documentation

◆ MODE_2

int MODE_2 = 2
static

Mode 2 encodes postal information in first message and data in second message.

Has 9 digits postal code (used only in USA).

◆ MODE_3

int MODE_3 = 3
static

Mode 3 encodes postal information in first message and data in second message.

Has 6 alphanumeric postal code, used in the world.

◆ MODE_4

int MODE_4 = 4
static

Mode 4 encodes data in first and second message, with short ECC correction.

◆ MODE_5

int MODE_5 = 5
static

Mode 5 encodes data in first and second message, with long ECC correction.

◆ MODE_6

int MODE_6 = 6
static

Mode 6 encodes data in first and second message, with short ECC correction.

Used to encode device.