Generate and Read Mailmark 4-State Barcodes in Java

Overview

Royal Mail of the United Kingdom has introduced the Mailmark 4-state postal barcode standard to store postal and shipping data. Its specification is alike the RM4SCC symbology but requires using the specific data format and does not allow adding customer-specific data. The Mailmark 4-state symbology can be used to encode numerical characters, uppercase letters of the English alphabet, and space. To ensure data integrity and correct barcode recognition, Mailmark 4-state barcodes contain checksum controls and supports Reed-Solomon error correction.

The Royal Mail Mailmark 4-state standard includes the following subtypes:

  • Type L - allows encoding up to 26 digits; is applied to machine-readable Low Sort and Unsorted Retail and Access 70 services
  • Type C - allows enconding up to 22 digits; is used for consolidated machine-readable Low Sort and Unsorted Retail and Access 70 services

To read and generate Mailmark 4-state barcode images, Aspose.BarCode for Java provides special class MailmarkCodetext.

Generate Mailmark 4-State Barcodes

Developers can create Mailmark 4-state barcodes in Aspose.BarCode for Java executing the following steps. First, an instance of class MailmarkCodetext needs to be created passing the data for encoding. Thereafter, the generateBarCodeImage() method of class ComplexBarcodeGenerator needs to be called to finalize barcode generation.

Read Mailmark 4-State Barcodes

To recognize Mailmark 4-state barcode images through Aspose.BarCode for Java, first, it is needed to generate an instance of class BarCodeReader setting it to DecodeType.Mailmark. Thereafter, barcode data has to be parsed using the TryDecodeMailmark(java.lang.String encodedCodetext) method of class ComplexCodetextReader. This method returns an instance of class MailmarkCodetext with the decoded barcode data.