HanXinExtCodetextBuilder

HanXinExtCodetextBuilder

Extended codetext generator for Han Xin Code for Extended Mode of HanXinEncodeMode



//Extended codetext mode
//create codetext
let codeTextBuilder = new HanXinExtCodetextBuilder();
codeTextBuilder.addGB18030TwoByte("漄");
codeTextBuilder.addGB18030FourByte("㐁");
codeTextBuilder.addCommonChineseRegionOne("全");
codeTextBuilder.addCommonChineseRegionTwo("螅");
codeTextBuilder.addNumeric("123");
codeTextBuilder.addText("qwe");
codeTextBuilder.addUnicode("ıntəˈnæʃənəl");
codeTextBuilder.addECI("ΑΒΓΔΕ", 9);
codeTextBuilder.addAuto("abc");
codeTextBuilder.addBinary("abc");
codeTextBuilder.addURI("backslashes_should_be_doubled\000555:test");
codeTextBuilder.addGS1("(01)03453120000011(17)191125(10)ABCD1234(21)10");
let expectedStr = "漄㐁全螅123qweıntəˈnæʃənəlΑΒΓΔΕabcabcbackslashes_should_be_doubled\000555:test(01)03453120000011(17)191125(10)ABCD1234(21)10";
//generate codetext
let str = codeTextBuilder.getExtendedCodetext();
//generate
let bg = new BarcodeGenerator(EncodeTypes.HAN_XIN, str);
bg.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(HanXinEncodeMode.EXTENDED);
let img = bg.generateBarCodeImage(BarcodeImageFormat.PNG);
let r = new BarCodeReader(img, null, DecodeType.HAN_XIN))
let found = r.readBarCodes();
assert.assertEquals(1, found.length);
assert.assertEquals(expectedStr, found[0].getCodeText());

Constructor

new HanXinExtCodetextBuilder()

Source:

Methods

addAuto(text)

Adds codetext fragment in Auto mode

Parameters:
Name Type Description
text Codetext string
Source:

addBinary(text)

Adds codetext fragment in Binary mode

Parameters:
Name Type Description
text Codetext string
Source:

addCommonChineseRegionOne(text)

Adds codetext fragment in Common Chinese Region One mode

Parameters:
Name Type Description
text Codetext string
Source:

addCommonChineseRegionTwo(text)

Adds codetext fragment in Common Chinese Region Two mode

Parameters:
Name Type Description
text Codetext string
Source:

addECI(text, encoding)

Adds codetext fragment in ECI mode

Parameters:
Name Type Description
text Codetext string
encoding ECI encoding in number format
Source:

addGB18030FourByte(text)

Adds codetext fragment in GB18030 Four Byte mode

Parameters:
Name Type Description
text Codetext string
Source:

addGB18030TwoByte(text)

Adds codetext fragment in GB18030 Two Byte mode

Parameters:
Name Type Description
text Codetext string
Source:

addGS1(text)

Adds codetext fragment in GS1 mode

Parameters:
Name Type Description
text Codetext string
Source:

addNumeric(text)

Adds codetext fragment in Numeric mode

Parameters:
Name Type Description
text Codetext string
Source:

addText(text)

Adds codetext fragment in Text mode

Parameters:
Name Type Description
text Codetext string
Source:

addURI(text)

Adds codetext fragment in URI mode

Parameters:
Name Type Description
text Codetext string
Source:

addUnicode(text)

Adds codetext fragment in Unicode mode

Parameters:
Name Type Description
text Codetext string
Source:

getExtendedCodetext()

Returns codetext from Extended mode codetext builder

Returns:
Type Description
Codetext in Extended mode
Source: