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

Encoding mode for DotCode barcodes. More...

Inherits Enum.

Static Public Attributes

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

# Auto mode with macros
codetext = "[) > \u001E05\u001DCodetextWithMacros05\u001E\u0004"
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.DOT_CODE, codetext)
generator.save(self.image_path_to_save, Generation.BarCodeImageFormat.BMP)
# Auto mode
codetext = "犬Right狗"
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.DOT_CODE, codetext)
generator.getParameters().getBarcode().getDotCode().setECIEncoding(Generation.ECIEncodings.UTF8)
generator.save(self.image_path_to_save, Generation.BarCodeImageFormat.BMP)
# Bytes mode
encodedArr = [0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9]
# encode array to string
codetext = ""
for bval in encodedArr:
codetext += str(bval)
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.DOT_CODE, None)
generator.setCodeText(encodedArr, None)
generator.getParameters().getBarcode().getDotCode().setDotCodeEncodeMode(Generation.DotCodeEncodeMode.BINARY)
generator.save(self.image_path_to_save4, Generation.BarCodeImageFormat.PNG)
# Extended codetext mode
# create codetext
textBuilder = Generation.DotCodeExtCodetextBuilder()
textBuilder.addFNC1FormatIdentifier()
textBuilder.addECICodetext(Generation.ECIEncodings.Win1251, "Will")
textBuilder.addFNC1FormatIdentifier()
textBuilder.addECICodetext(Generation.ECIEncodings.UTF8, "犬Right狗")
textBuilder.addFNC3SymbolSeparator()
textBuilder.addFNC1FormatIdentifier()
textBuilder.addECICodetext(Generation.ECIEncodings.UTF16BE, "犬Power狗")
textBuilder.addPlainCodetext("Plain text")
# generate codetext
codetext = textBuilder.getExtendedCodetext()
# generate
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.DOT_CODE, codetext)
generator.getParameters().getBarcode().getDotCode().setDotCodeEncodeMode(Generation.DotCodeEncodeMode.EXTENDED_CODETEXT)
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 = 3
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 = 4
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 = 5
static

Extended mode which supports multi ECI modes.

It is better to use DotCodeExtCodetextBuilder 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 DotCodeExtCodetextBuilder 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: