Free Support Forum -

USPS OneCode Barcode


Can Aspose generate a USPS OneCode barcode from both the encoded 65 character string and the decoded 31 digit number value?



You may generate barcode using the following code snippet:

string code = "1234567898745632145698745632145";
using (BarCodeGenerator barCodeGenerator = new BarCodeGenerator(EncodeTypes.OneCode, code))
    barCodeGenerator.Save(TestDirectory + "test.png", BarCodeImageFormat.Png);

The following code snippet could be used to read Barcode:

   BarCodeReader barCodeReader = new BarCodeReader(TestDirectory + "test.png", DecodeType.OneCode);
   while (barCodeReader.Read())
                    Console.WriteLine("CodeText: " + barCodeReader.GetCodeText());

Please feel free to write back to us if you having any further issue or if you need any additional information in this regard.


Thank you for this reply. Is it possible to use Aspose to decode a 65 encoded string like this into the 31 digit code?




Thank you for your feedback.

Aspose.BarCode API throws invalid codetext exception with the string provided so we have logged this issue with ID “BARCODENET-37125” for further investigation. You will automatically be informed here once we have more information to share.