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

Han Xin Code encoding mode. More...

Inherits Enum.

Static Public Attributes

int AUTO = 0
 Sequence of Numeric, Text, ECI, Binary Bytes and 4 GB18030 modes changing automatically. More...
 
int BINARY = 1
 Binary byte mode encodes binary data in any form and encodes them in their binary byte. More...
 
int ECI = 2
 Extended Channel Interpretation (ECI) mode. More...
 
int EXTENDED = 5
 Extended mode will allow more flexible combinations of other modes, this mode is currently not implemented. More...
 
int UNICODE = 3
 Unicode mode designs a way to represent any text data reference to UTF8 encoding/charset in Han Xin Code. More...
 
int URI = 4
 URI mode indicates the data represented in Han Xin Code is Uniform Resource Identifier (URI) reference to RFC 3986. More...
 

Detailed Description

Han Xin Code encoding mode.

It is recommended to use Auto with ASCII / Chinese characters or Unicode for Unicode characters.

Auto mode

codetext = "1234567890ABCDEFGabcdefg,Han Xin Code"
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.HAN_XIN, codetext)
generator.save(self.image_path_to_save5, Generation.BarCodeImageFormat.BMP)
# Binary mode
encodedArr = [0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9]
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.HAN_XIN, None)
generator.setCodeText(encodedArr, None)
generator.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(Generation.HanXinEncodeMode.BINARY)
generator.save(self.image_path_to_save5, Generation.BarCodeImageFormat.BMP)
# ECI mode
codetext = "ΑΒΓΔΕ"
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.HAN_XIN, codetext)
generator.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(Generation.HanXinEncodeMode.ECI)
generator.getParameters().getBarcode().getHanXin().setHanXinECIEncoding(Generation.ECIEncodings.ISO_8859_7)
generator.save(self.image_path_to_save5, Generation.BarCodeImageFormat.BMP)
# URI mode
codetext = "https://www.test.com/%BC%DE%%%ab/search=test"
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.HAN_XIN, codetext)
generator.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(Generation.HanXinEncodeMode.URI)
generator.save(self.image_path_to_save5, Generation.BarCodeImageFormat.BMP)

Member Data Documentation

◆ AUTO

int AUTO = 0
static

Sequence of Numeric, Text, ECI, Binary Bytes and 4 GB18030 modes changing automatically.

◆ BINARY

int BINARY = 1
static

Binary byte mode encodes binary data in any form and encodes them in their binary byte.

Every byte in Binary Byte mode is represented by 8 bits.

◆ ECI

int ECI = 2
static

Extended Channel Interpretation (ECI) mode.

◆ EXTENDED

int EXTENDED = 5
static

Extended mode will allow more flexible combinations of other modes, this mode is currently not implemented.

◆ UNICODE

int UNICODE = 3
static

Unicode mode designs a way to represent any text data reference to UTF8 encoding/charset in Han Xin Code.

◆ URI

int URI = 4
static

URI mode indicates the data represented in Han Xin Code is Uniform Resource Identifier (URI) reference to RFC 3986.