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

Class for encoding and decoding the text embedded in the MaxiCode code for modes 2. More...

Inherits MaxiCodeStructuredCodetext.

Public Member Functions

def __init__ (self)
 
def getMode (self)
 Gets MaxiCode mode. More...
 
def init (self)
 
- Public Member Functions inherited from MaxiCodeStructuredCodetext
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...
 
- Public Member Functions inherited from MaxiCodeCodetext
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...
 
- Public Member Functions inherited from BaseJavaClass
def getJavaClass (self)
 
def getJavaClassName (self)
 
def isNull (self)
 
def printJavaClassName (self)
 
def setJavaClass (self, javaClass)
 

Static Public Member Functions

def construct (javaClass)
 

Static Public Attributes

string JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeCodetextMode2"
 
- Static Public Attributes inherited from MaxiCodeStructuredCodetext
string JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeStructuredCodetext"
 

Additional Inherited Members

- Public Attributes inherited from MaxiCodeStructuredCodetext
 maxiCodeSecondMessage
 
- Public Attributes inherited from BaseJavaClass
 javaClass
 
 javaClassName
 

Detailed Description

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)

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Member Function Documentation

◆ construct()

def construct (   javaClass)
static

◆ getMode()

def getMode (   self)

Gets MaxiCode mode.

Returns
: MaxiCode mode

Reimplemented from MaxiCodeCodetext.

◆ init()

def init (   self)

Reimplemented from MaxiCodeStructuredCodetext.

Member Data Documentation

◆ JAVA_CLASS_NAME

string JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeCodetextMode2"
static