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

Encoding mode for MaxiCode barcodes. More...

Inherits Enum.

Static Public Attributes

int AUTO = 0
 Encode codetext with value set in the ECIEncoding property. More...
int BYTES = 1
 Encode codetext as plain bytes. More...
 Extended mode which supports multi ECI modes. More...

Detailed Description

Encoding mode for MaxiCode barcodes.

# Auto mode
codetext = "犬Right狗"
generator = BarcodeGenerator(EncodeTypes.MAXI_CODE, codetext))
generator.getParameters().getBarcode().getMaxiCode().setECIEncoding(ECIEncodings.UTF8)"test.bmp", BarcodeImageFormat.BMP)
#Bytes mode
encodedArr = [ 0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9 ]
# encode array to string
strBld = ""
for bval in encodedArr:
strBld += bval
codetext = strBld
generator = BarcodeGenerator(EncodeTypes.MAXI_CODE, codetext))
generator.getParameters().getBarcode().getMaxiCode().setMaxiCodeEncodeMode(MaxiCodeEncodeMode.BYTES)"test.bmp", BarcodeImageFormat.BMP)
# Extended codetext mode
# create codetext
textBuilder = MaxiCodeExtCodetextBuilder()
textBuilder.addECICodetext(ECIEncodings.Win1251, "Will")
textBuilder.addECICodetext(ECIEncodings.UTF8, "犬Right狗")
textBuilder.addECICodetext(ECIEncodings.UTF16BE, "犬Power狗")
textBuilder.addPlainCodetext("Plain text")
# generate codetext
codetext = textBuilder.getExtendedCodetext()
# generate
generator = BarcodeGenerator(EncodeTypes.MaxiCode, codetext)
generator.getParameters().getBarcode().getMaxiCode().setTwoDDisplayText("My Text")"test.bmp", BarcodeImageFormat.BMP)

Member Data Documentation


int AUTO = 0

Encode codetext with value set in the ECIEncoding property.


int BYTES = 1

Encode codetext as plain bytes.

If it detects any Unicode character, the character will be encoded as two bytes, lower byte first.



Extended mode which supports multi ECI modes.

It is better to use MaxiCodeExtCodetextBuilder for extended codetext generation.
Use Display2DText property to set visible text to removing managing characters.
ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
All unicode characters after ECI identifier are automatically encoded into correct character codeset.