Class for encoding and decoding the text embedded in the MaxiCode code for modes 2.
More...
|
def | __init__ (self) |
|
def | getMode (self) |
| Gets MaxiCode mode. More...
|
|
def | init (self) |
|
def | __init__ (self, javaClass) |
|
def | equals (self, obj) |
|
def | getConstructedCodetext (self) |
|
def | getCountryCode (self) |
| Identifies 3 digit country code. More...
|
|
def | getHashCode (self) |
| Returns the hash code for this instance. More...
|
|
def | getPostalCode (self) |
| Identifies the postal code. More...
|
|
def | getSecondMessage (self) |
| Identifies second message of the barcode. More...
|
|
def | getServiceCategory (self) |
| Identifies 3 digit service category. More...
|
|
def | initFromString (self, constructedCodetext) |
|
def | setCountryCode (self, value) |
| Identifies 3 digit country code. More...
|
|
def | setPostalCode (self, value) |
| Identifies the postal code. More...
|
|
def | setSecondMessage (self, value) |
| Identifies second message of the barcode. More...
|
|
def | setServiceCategory (self, value) |
| Identifies 3 digit service category. More...
|
|
def | getBarcodeType (self) |
| Gets barcode type. More...
|
|
def | getECIEncoding (self) |
| Gets ECI encoding. More...
|
|
def | getMaxiCodeEncodeMode (self) |
| Gets a MaxiCode encode mode. More...
|
|
def | setECIEncoding (self, value) |
| Sets ECI encoding. More...
|
|
def | setMaxiCodeEncodeMode (self, value) |
| Sets a MaxiCode encode mode. More...
|
|
def | getJavaClass (self) |
|
def | getJavaClassName (self) |
|
def | isNull (self) |
|
def | printJavaClassName (self) |
|
def | setJavaClass (self, javaClass) |
|
Class for encoding and decoding the text embedded in the MaxiCode code for modes 2.
This sample shows how to encode and decode MaxiCode codetext for mode 2.
maxiCodeCodetext = MaxiCodeCodetextMode2()
maxiCodeCodetext.setPostalCode("524032140")
maxiCodeCodetext.setCountryCode(056)
maxiCodeCodetext.setServiceCategory(999)
maxiCodeStandartSecondMessage = MaxiCodeStandartSecondMessage()
maxiCodeStandartSecondMessage.setMessage("Test message")
maxiCodeCodetext.setSecondMessage(maxiCodeStandartSecondMessage)
complexGenerator = ComplexBarcodeGenerator(maxiCodeCodetext)
complexGenerator.generateBarCodeImage()
\code
maxiCodeCodetext = MaxiCodeCodetextMode2() maxiCodeCodetext.setPostalCode("524032140") maxiCodeCodetext.setCountryCode(056) maxiCodeCodetext.setServiceCategory(999) maxiCodeStructuredSecondMessage = MaxiCodeStructuredSecondMessage() maxiCodeStructuredSecondMessage.add("634 ALPHA DRIVE") maxiCodeStructuredSecondMessage.add("PITTSBURGH") maxiCodeStructuredSecondMessage.add("PA") maxiCodeStructuredSecondMessage.setYear(99) maxiCodeCodetext.setSecondMessage(maxiCodeStructuredSecondMessage) complexGenerator = ComplexBarcodeGenerator(maxiCodeCodetext) complexGenerator.generateBarCodeImage()
reader = Recognition.BarCodeReader(imagePath, None, DecodeType.MAXI_CODE) for result in reader.readBarCodes(): resultMaxiCodeCodetext = ComplexCodetextReader.tryDecodeMaxiCode( result.getExtended().getMaxiCode().getMaxiCodeMode(), result.getCodeText()) if resultMaxiCodeCodetext is MaxiCodeCodetextMode2: maxiCodeStructuredCodetext = resultMaxiCodeCodetext print("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode()) print("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode()) print("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory()) if maxiCodeStructuredCodetext.SecondMessage is MaxiCodeStandartSecondMessage: secondMessage = maxiCodeStructuredCodetext.getSecondMessage() print("Message: " + secondMessage.getMessage())
reader = Recognition.BarCodeReader(imagePath, None, DecodeType.MAXI_CODE) for result in reader.readBarCodes(): resultMaxiCodeCodetext = ComplexCodetextReader.tryDecodeMaxiCode( result.getExtended().getMaxiCode().getMaxiCodeMode(), result.getCodeText()) if resultMaxiCodeCodetext is MaxiCodeCodetextMode2: maxiCodeStructuredCodetext = resultMaxiCodeCodetext print("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode()) print("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode()) print("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory()) if maxiCodeStructuredCodetext.SecondMessage is MaxiCodeStructuredSecondMessage: secondMessage = maxiCodeStructuredCodetext.getSecondMessage() print("Message:") for identifier in secondMessage.getIdentifiers(): print(identifier)