Generate and Read Mailmark 4-State Barcodes in C++

Overview

The Mailmark 4-state postal symbology has been introduced by Royal Mail of the United Kingdom to encode information about postal and shipping operations. It has a specification similar to the RM4SCC standard but implies using a strictly fixed data format and does not provide extra space for customer-specific information. The Mailmark 4-state barcode type allows encoding numerical digits, uppercase English letters, and space. Moreover, Mailmark 4-state barcodes include a checksum and specific information for Reed-Solomon error correction.

The Royal Mail Mailmark 4-state enables the following barcode types:

  • Type L - encodes 26 characters and is intended for machine-readable Low Sort and Unsorted Retail and Access 70 services
  • Type C - encodes 22 characters and is intended for consolidated machine-readable Low Sort and Unsorted Retail and Access 70 services

Aspose.BarCode for C++ defines class MailmarkCodetext to work with this symbology.

Generate Mailmark 4-State Barcode

To generate a Mailmark 4-state barcode in Aspose.BarCode for C++, first, it is necessary to create an instance of class MailmarkCodetext and enter the information to be encoded. Then, class ComplexBarcodeGenerator is used to complete barcode generation.

Read Mailmark 4-State Barcode

To read and parse Royal Mail Mailmark 4-state barcodes in Aspose.BarCode for C++, it is necessary to create an instance of class BarCodeReader and set it to the value DecodeType.Mailmark. After that, the fetched data must be parsed further using class ComplexCodetextReader by calling the TryDecodeMailmark method that returns an instance of MailmarkCodetext with the decoded barcode contents.