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

Encoding mode for QR barcodes. More...

Inherits Enum.

Static Public Attributes

int AUTO = 0
 In Auto mode, the CodeText is encoded with maximum data compactness. More...
 
int BINARY = 7
 In Binary mode, the CodeText is encoded with maximum data compactness. More...
 
int BYTES = 1
 Encode codetext as plain bytes. More...
 
int ECI = 8
 In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier. More...
 
int ECI_ENCODING = 4
 Encode codetext with value set in the ECIEncoding property. More...
 
int EXTENDED = 6
 Extended Channel mode which supports FNC1 first position, FNC1 second position and multi ECI modes. More...
 
int EXTENDED_CODETEXT = 5
 Extended Channel mode which supports FNC1 first position, FNC1 second position and multi ECI modes. More...
 
int UTF_16_BEBOM = 3
 Encode codetext with UTF8 encoding with first ByteOfMark character. More...
 
int UTF_8_BOM = 2
 Encode codetext with UTF8 encoding with first ByteOfMark character. More...
 

Detailed Description

Encoding mode for QR barcodes.

Example how to use ECI encoding

generator = Generation.BarcodeGenerator(Generation.EncodeTypes.QR, "12345TEXT") generator.getParameters().getBarcode().getQR().setQrEncodeMode(Generation.QREncodeMode.ECI_ENCODING) generator.getParameters().getBarcode().getQR().setQrECIEncoding(Generation.ECIEncodings.UTF8) generator.save(self.image_path_to_save4, Generation.BarCodeImageFormat.PNG)

Example how to use FNC1 first position in Extended Mode

textBuilder = Generation.QrExtCodetextBuilder() textBuilder.addPlainCodetext("000%89%%0") textBuilder.addFNC1GroupSeparator() textBuilder.addPlainCodetext("12345<FNC1>")

generate barcode

generator = Generation.BarcodeGenerator(Generation.EncodeTypes.QR, None) generator.setCodeText(textBuilder.getExtendedCodetext(),"UTF-8") generator.getParameters().getBarcode().getQR().setQrEncodeMode(Generation.QREncodeMode.EXTENDED_CODETEXT) generator.getParameters().getBarcode().getCodeTextParameters().setTwoDDisplayText("My Text") generator.save(self.image_path_to_save6, Generation.BarCodeImageFormat.PNG)

This sample shows how to use FNC1 second position in Extended Mode.

create codetext

textBuilder = Generation.QrExtCodetextBuilder() textBuilder.addFNC1SecondPosition("12") textBuilder.addPlainCodetext("TRUE3456")

generate barcode

generator = Generation.BarcodeGenerator(Generation.EncodeTypes.QR, None) generator.setCodeText(textBuilder.getExtendedCodetext(), "UTF-8") generator.getParameters().getBarcode().getCodeTextParameters().setTwoDDisplayText("My Text") generator.save(self.image_path_to_save7, Generation.BarCodeImageFormat.PNG)

This sample shows how to use multi ECI mode in Extended Mode.

create codetext

textBuilder = Generation.QrExtCodetextBuilder() textBuilder.addECICodetext(Generation.ECIEncodings.Win1251, "Will") textBuilder.addECICodetext(Generation.ECIEncodings.UTF8, "Right") textBuilder.addECICodetext(Generation.ECIEncodings.UTF16BE, "Power") textBuilder.addPlainCodetext("t\e\\st")

generate barcode

generator = Generation.BarcodeGenerator(Generation.EncodeTypes.QR, "12345") generator.setCodeText(textBuilder.getExtendedCodetext(),"UTF-8") generator.getParameters().getBarcode().getQR().setQrEncodeMode(Generation.QREncodeMode.EXTENDED_CODETEXT) generator.getParameters().getBarcode().getCodeTextParameters().setTwoDDisplayText("My Text") generator.save(self.image_path_to_save8, Generation.BarCodeImageFormat.PNG)

Member Data Documentation

◆ AUTO

int AUTO = 0
static

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

Unicode characters are encoded in kanji mode if possible, or they 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 = 7
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:
This property is obsolete and will be removed in future releases. Instead, use the 'SetCodeText' method to convert the message to byte array with specified encoding.

◆ ECI

int ECI = 8
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. This mode is not supported by MicroQR barcodes.

◆ ECI_ENCODING

int ECI_ENCODING = 4
static

Encode codetext with value set in the ECIEncoding property.

It can be problems with some old (pre 2006) barcode scanners. This mode is not supported by MicroQR barcodes.

Deprecated:
This property is obsolete and will be removed in future releases. Instead, use ECI option.

◆ EXTENDED

int EXTENDED = 6
static

Extended Channel mode which supports FNC1 first position, FNC1 second position and multi ECI modes.

It is better to use QrExtCodetextBuilder for extended codetext generation.

Use Display2DText property to set visible text to removing managing characters.

Encoding Principles:

All symbols "\" must be doubled "\\" in the codetext.

FNC1 in first position is set in codetext as as "<FNC1>"

FNC1 in second position is set in codetext as as "<FNC1(value)>". The value must be single symbols (a-z, A-Z) or digits from 0 to 99.

Group Separator for FNC1 modes is set as 0x1D character '\u001D'

If you need to insert "<FNC1>" string into barcode write it as "<\FNC1>"

ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier

To disable current ECI mode and convert to default JIS8 mode zero mode ECI indetifier is set. "\000000"

All unicode characters after ECI identifier are automatically encoded into correct character codeset.

This mode is not supported by MicroQR barcodes.

◆ EXTENDED_CODETEXT

int EXTENDED_CODETEXT = 5
static

Extended Channel mode which supports FNC1 first position, FNC1 second position and multi ECI modes.

It is better to use QrExtCodetextBuilder for extended codetext generation.

Use Display2DText property to set visible text to removing managing characters.

Encoding Principles:

All symbols "\" must be doubled "\\" in the codetext.

FNC1 in first position is set in codetext as as "<FNC1>"

FNC1 in second position is set in codetext as as "<FNC1(value)>". The value must be single symbols (a-z, A-Z) or digits from 0 to 99.

Group Separator for FNC1 modes is set as 0x1D character '\u001D'

If you need to insert "<FNC1>" string into barcode write it as "<\FNC1>"

ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier

To disable current ECI mode and convert to default JIS8 mode zero mode ECI indetifier is set. "\000000"

All unicode characters after ECI identifier are automatically encoded into correct character codeset.

This mode is not supported by MicroQR barcodes.

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

◆ UTF_16_BEBOM

int UTF_16_BEBOM = 3
static

Encode codetext with UTF8 encoding with first ByteOfMark character.

It can be problems with some barcode scanners.

Deprecated:
This property is obsolete and will be removed in future releases. Instead, use the 'SetCodeText' method with BigEndianUnicode encoding to add a byte order mark (BOM) and encode the message. After that, the CodeText can be encoded using the 'Auto' mode.

◆ UTF_8_BOM

int UTF_8_BOM = 2
static

Encode codetext with UTF8 encoding with first ByteOfMark character.

Deprecated:
This property is obsolete and will be removed in future releases. Instead, use the 'SetCodeText' method with UTF8 encoding to add a byte order mark (BOM) and encode the message. After that, the CodeText can be encoded using the 'Auto' mode.