Mailmark 2D Barcodes
Royal Mail Mailmark has been developed to encode postal and shipping information in the format defined in the DataMatrix standard. Mailmark 2D includes three types denoted as 7, 9, and 29; they differ from each other in terms of customer data capacity. Customer information is encoded in addition to the main barcode data in special predefined barcode fields. The amount of space to store customer data depends on the barcode type and the used encoding. This information can serve to describe print and scanning operations, identify items, or enable barcode scanning with smartphones.
To perform data encoding, the Mailmark 2D standard uses the basic C40 character set (numerical digits, uppercase English letters, and the space character). All fields of information to be encoded in a Mailmark 2D barcode except customer data must be entered in the format compatible with the mentioned encoding standard. The customer information field does not require to comply with this encoding; however, using alternative encodings may affect the overall barcode data capacity.
To work with Mailmark 2D barcodes in Aspose.BarCode for Python via .NET, it is necessary to use class Mailmark2DCodetext.
Generate Mailmark 2D Barcodes
To generate Mailmark 2D barcodes, the barcode library provides class Mailmark2DCodetext to specify barcode fields and class ComplexBarcodeGenerator to generate barcodes. The Mailmark2DType enumeration is used to select the type of a Mailmark 2D barcode to be generated.
Sample Mailmark 2D barcodes demonstrated below have been created setting different Mailmark 2D types.
|Mailmark 2D||Type 7||Type 9||Type 29|
Read Mailmark 2D Barcodes
To read and parse Royal Mail Mailmark 2D barcodes, first, it is required to create an instance of class BarCodeReader and set it to the value DecodeType.DataMatrix. Then, the obtained information can be parsed further in class ComplexCodetextReader by calling the try_decode_mailmark_2d(encoded_codetext) method that returns an instance of Mailmark2DCodetext with the decoded barcode data.