Aspose.BarCode for Python via Java  24.11
Aspose.Barcode for Python via Java Generation and Recognition API docs
MaxiCodeCodetextMode3 Class Reference

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

Inherits MaxiCodeStructuredCodetext.

Public Member Functions

None __init__ (self)
 
Optional[Generation.MaxiCodeModegetMode (self)
 Gets MaxiCode mode. More...
 
None init (self)
 
- Public Member Functions inherited from MaxiCodeStructuredCodetext
None __init__ (self, javaClass)
 
bool __eq__ (self, MaxiCodeStructuredCodetext other)
 Returns a value indicating whether this instance is equal to a specified MaxiCodeStructuredCodetext value. More...
 
Optional[str] getConstructedCodetext (self)
 Constructs codetext. More...
 
int getCountryCode (self)
 Identifies 3 digit country code. More...
 
int getHashCode (self)
 Returns the hash code for this instance. More...
 
str getPostalCode (self)
 Identifies the postal code. More...
 
Optional[MaxiCodeSecondMessagegetSecondMessage (self)
 Identifies second message of the barcode. More...
 
int getServiceCategory (self)
 Identifies 3 digit service category. More...
 
None initFromString (self, str constructedCodetext)
 Initializes instance from constructed codetext. More...
 
None setCountryCode (self, int value)
 Identifies 3 digit country code. More...
 
None setPostalCode (self, str value)
 Identifies the postal code. More...
 
None setSecondMessage (self, MaxiCodeSecondMessage value)
 Identifies second message of the barcode. More...
 
None setServiceCategory (self, int value)
 Identifies 3 digit service category. More...
 
- Public Member Functions inherited from MaxiCodeCodetext
Generation.EncodeTypes getBarcodeType (self)
 Gets barcode type. More...
 
Generation.ECIEncodings getECIEncoding (self)
 Gets ECI encoding. More...
 
Generation.MaxiCodeEncodeMode getMaxiCodeEncodeMode (self)
 Gets a MaxiCode encode mode. More...
 
None setECIEncoding (self, Generation.ECIEncodings eciEncodings)
 Sets ECI encoding. More...
 
None setMaxiCodeEncodeMode (self, Generation.MaxiCodeEncodeMode value)
 Sets a MaxiCode encode mode. More...
 
- Public Member Functions inherited from BaseJavaClass
def getJavaClass (self)
 
str getJavaClassName (self)
 
bool isNull (self)
 
None printJavaClassName (self)
 
None setJavaClass (self, javaClass)
 

Static Public Member Functions

MaxiCodeCodetextMode3 construct (javaClass)
 

Static Public Attributes

string JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeCodetextMode3"
 
- 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 3.

This sample shows how to encode and decode MaxiCode codetext for mode 3.

# Mode 3 with standart second message
maxiCodeCodetext = MaxiCodeCodetextMode3()
maxiCodeCodetext.setPostalCode("B1050")
maxiCodeCodetext.setCountryCode(056)
maxiCodeCodetext.setServiceCategory(999)
maxiCodeStandartSecondMessage = MaxiCodeStandartSecondMessage()
maxiCodeStandartSecondMessage.setMessage("Test message")
maxiCodeCodetext.setSecondMessage(maxiCodeStandartSecondMessage)
complexGenerator = ComplexBarcodeGenerator(maxiCodeCodetext)
complexGenerator.generateBarCodeImage()
# Mode 3 with structured second message
maxiCodeCodetext = MaxiCodeCodetextMode3()
maxiCodeCodetext.setPostalCode("B1050")
maxiCodeCodetext.setCountryCode(156)
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()
# Decoding raw codetext with standart second message
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 MaxiCodeCodetextMode3:
maxiCodeStructuredCodetext = resultMaxiCodeCodetext
print("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode())
print("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode())
print("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory())
if maxiCodeStructuredCodetext.getSecondMessage() 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 MaxiCodeCodetextMode3:
maxiCodeStructuredCodetext = resultMaxiCodeCodetext
print("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode())
print("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode())
print("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory())
if maxiCodeStructuredCodetext.getSecondMessage() is MaxiCodeStructuredSecondMessage:
secondMessage = maxiCodeStructuredCodetext.getSecondMessage()
print("Message:")
for identifier in secondMessage.getIdentifiers():
print(identifier)

Constructor & Destructor Documentation

◆ __init__()

None __init__ (   self)

Member Function Documentation

◆ construct()

MaxiCodeCodetextMode3 construct (   javaClass)
static

◆ getMode()

Optional[Generation.MaxiCodeMode] getMode (   self)

Gets MaxiCode mode.

Returns
:MaxiCode mode or None if not set.

Reimplemented from MaxiCodeCodetext.

◆ init()

None init (   self)

Reimplemented from MaxiCodeStructuredCodetext.

Member Data Documentation

◆ JAVA_CLASS_NAME

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