Aspose.Barcode for PHP via Java Generation and Recognition API docs
AztecEncodeMode Class Reference

Public Attributes

const AUTO = 0
const BYTES = 1

Detailed Description

Encoding mode for Aztec barcodes.

//Auto mode
$codetext = "犬Right狗";
$generator = new BarcodeGenerator(EncodeTypes::AZTEC, $codetext);
$generator->save("test.bmp", BarcodeImageFormat::BMP);
//Bytes mode
$encodedArr = [0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9];
//encode array to string
$strBld = "";
foreach($encodedArr as bval)
$codetext = $strBld->toString();
$generator = new BarcodeGenerator(EncodeTypes::AZTEC, $codetext);
$generator->save("test.bmp", BarcodeImageFormat::BMP);
//Extended codetext mode
//create codetext
$textBuilder = new AztecExtCodetextBuilder();
$textBuilder->addECICodetext(ECIEncodings::Win1251, "Will");
$textBuilder->addECICodetext(ECIEncodings::UTF8, "犬Right狗");
$textBuilder->addECICodetext(ECIEncodings::UTF16BE, "犬Power狗");
$textBuilder->addPlainCodetext("Plain text");
//generate codetext
$codetext = $textBuilder->getExtendedCodetext();
$generator = new BarcodeGenerator(EncodeTypes::AZTEC, codetext);
$generator->getParameters()->getBarcode()->getCodeTextParameters()->setTwoDDisplayText("My Text");
$generator->save("test.bmp", BarcodeImageFormat::BMP);

Member Data Documentation


const AztecEncodeMode::AUTO = 0

Encode codetext with value set in the ECIEncoding property.


const AztecEncodeMode::BYTES = 1

Encode codetext as plain bytes. If it detects any Unicode character, the character will be encoded as two bytes, lower byte first.


const AztecEncodeMode::EXTENDED_CODETEXT = 2

Extended mode which supports multi ECI modes.

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