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

DataMatrix encoder's encoding mode, default to Auto. More...

Inherits Enum.

Static Public Attributes

int ANSIX12 = 11
 Uses ANSI X12 encoding. More...
 
int ASCII = 1
 Encodes one alphanumeric or two numeric characters per byte. More...
 
int AUTO = 0
 In Auto mode, the CodeText is encoded with maximum data compactness. More...
 
int BASE_256 = 14
 Encode 8 bit values. More...
 
int BINARY = 15
 In Binary mode, the CodeText is encoded with maximum data compactness. More...
 
int BYTES = 6
 Encode 8 bit values. More...
 
int C40 = 8
 Uses C40 encoding. More...
 
int ECI = 16
 In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier. More...
 
int EDIFACT = 10
 Uses EDIFACT encoding. More...
 
int EXTENDED = 13
 ExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext. More...
 
int EXTENDED_CODETEXT = 12
 ExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext. More...
 
int TEXT = 9
 Uses Text encoding. More...
 

Detailed Description

DataMatrix encoder's encoding mode, default to Auto.

This sample shows how to do codetext in Extended Mode.

#Auto mode codetext = "犬Right狗" generator = Generation.BarcodeGenerator(Generation.EncodeTypes.DATA_MATRIX, codetext) generator.getParameters().getBarcode().getDataMatrix().setECIEncoding(Generation.ECIEncodings.UTF8) generator.save(self.image_path_to_save5, Generation.BarCodeImageFormat.PNG)

Binary mode

encodedArr = [0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9] generator = Generation.BarcodeGenerator(Generation.EncodeTypes.DATA_MATRIX, None) generator.setCodeText(encodedArr, None) generator.getParameters().getBarcode().getDataMatrix().setDataMatrixEncodeMode( Generation.DataMatrixEncodeMode.BINARY) generator.save(self.image_path_to_save5, Generation.BarCodeImageFormat.PNG)

Extended codetext mode

create codetext

codetextBuilder = Generation.DataMatrixExtCodetextBuilder() codetextBuilder.addECICodetextWithEncodeMode(Generation.ECIEncodings.Win1251, Generation.DataMatrixEncodeMode.BYTES, "World") codetextBuilder.addPlainCodetext("Will") codetextBuilder.addECICodetext(Generation.ECIEncodings.UTF8, "犬Right狗") codetextBuilder.addCodetextWithEncodeMode(Generation.DataMatrixEncodeMode.C40, "ABCDE")

generate codetext

codetext = codetextBuilder.getExtendedCodetext()

generate

generator = Generation.BarcodeGenerator(Generation.EncodeTypes.DATA_MATRIX, codetext) generator.getParameters().getBarcode().getDataMatrix().setDataMatrixEncodeMode( Generation.DataMatrixEncodeMode.EXTENDED_CODETEXT) generator.save(self.image_path_to_save5, Generation.BarCodeImageFormat.PNG)

Member Data Documentation

◆ ANSIX12

int ANSIX12 = 11
static

Uses ANSI X12 encoding.

◆ ASCII

int ASCII = 1
static

Encodes one alphanumeric or two numeric characters per byte.

◆ 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.

◆ BASE_256

int BASE_256 = 14
static

Encode 8 bit values.

◆ BINARY

int BINARY = 15
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 = 6
static

Encode 8 bit values.

Deprecated:
This property is obsolete and will be removed in future releases.

Instead, use Base256 option.

◆ C40

int C40 = 8
static

Uses C40 encoding.

Encodes Upper-case alphanumeric, Lower case and special characters

◆ ECI

int ECI = 16
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.

◆ EDIFACT

int EDIFACT = 10
static

Uses EDIFACT encoding.

Uses six bits per character, encodes digits, upper-case letters, and many punctuation marks, but has no support for lower-case letters.

◆ EXTENDED

int EXTENDED = 13
static

ExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext.

It is better to use DataMatrixExtCodetextBuilder 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.

Encodation schemes are set in the next format : "\Encodation_scheme_name:text\Encodation_scheme_name:text". Allowed encodation schemes are: EDIFACT, ANSIX12, ASCII, C40, Text, Auto.

All backslashes () must be doubled in text.

◆ EXTENDED_CODETEXT

int EXTENDED_CODETEXT = 12
static

ExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext.

It is better to use DataMatrixExtCodetextBuilder 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.

Encodation schemes are set in the next format : "\Encodation_scheme_name:text\Encodation_scheme_name:text". Allowed encodation schemes are: EDIFACT, ANSIX12, ASCII, C40, Text, Auto.

All backslashes () must be doubled in text.

Deprecated:
This property is obsolete and will be removed in future releases. Instead, use the 'Extended' encode mode

◆ TEXT

int TEXT = 9
static

Uses Text encoding.

Encodes Lower-case alphanumeric, Upper case and special characters