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
 In Auto mode, the CodeText is encoded with maximum data compactness. More...
 
int BINARY = 4
 In Binary mode, the CodeText is encoded with maximum data compactness. More...
 
int BYTES = 1
 Encode codetext as plain bytes. More...
 
int ECI = 5
 In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier. More...
 
int EXTENDED = 3
 Extended mode which supports multi ECI modes. More...
 
int EXTENDED_CODETEXT = 2
 Extended mode which supports multi ECI modes. More...
 

Detailed Description

Encoding mode for MaxiCode barcodes.

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

Member Data Documentation

◆ AUTO

int AUTO = 0
static

In Auto mode, the CodeText is encoded with maximum data compactness.

Unicode characters are re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier. If a character is found that is not supported by the selected ECI encoding, an exception is thrown.

◆ BINARY

int BINARY = 4
static

In Binary mode, the CodeText is encoded with maximum data compactness.

If a Unicode character is found, an exception is thrown.

◆ BYTES

int BYTES = 1
static

Encode codetext as plain bytes.

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

Deprecated:

◆ ECI

int ECI = 5
static

In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.

If a character is found that is not supported by the selected ECI encoding, an exception is thrown. Please note that some old (pre 2006) scanners may not support this mode.

◆ EXTENDED

int EXTENDED = 3
static

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.

◆ EXTENDED_CODETEXT

int EXTENDED_CODETEXT = 2
static

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.

Deprecated: