Aspose.Barcode for PHP via Java Generation and Recognition API docs
|
Public Attributes | |
const | AUTO = 0 |
const | BYTES = 1 |
const | EXTENDED_CODETEXT = 2 |
const | EXTENDED = 3 |
const | BINARY = 4 |
const | ECI = 5 |
Encoding mode for Aztec barcodes.
//Auto mode$codetext = "犬Right狗";$generator->getParameters()->getBarcode()->getAztec()->setECIEncoding(ECIEncodings::UTF_8);$generator->save("test.bmp", BarcodeImageFormat::BMP);@code//Bytes mode$encodedArr = [0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9];//encode array to string$strBld = "";foreach($encodedArr as bval)$strBld->append(chr(bval));$codetext = $strBld->toString();$generator->getParameters()->getBarcode()->getAztec()->setAztecEncodeMode(AztecEncodeMode::BYTES);$generator->save("test.bmp", BarcodeImageFormat::BMP);@code//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();//generate$generator->getParameters()->getBarcode()->getAztec()->setAztecEncodeMode(AztecEncodeMode::EXTENDED_CODETEXT);$generator->getParameters()->getBarcode()->getCodeTextParameters()->setTwoDDisplayText("My Text");$generator->save("test.bmp", BarcodeImageFormat::BMP);</pre></pre></blockquote></hr></p>
const AztecEncodeMode::AUTO = 0 |
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.
const AztecEncodeMode::BINARY = 4 |
In Binary mode, the CodeText is encoded with maximum data compactness. If a Unicode character is found, an exception is thrown.
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::ECI = 5 |
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.
const AztecEncodeMode::EXTENDED = 3 |
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.
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.