Free Support Forum - aspose.com

USPS OneCode Barcode


#1

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


#2

@dankick

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.


#3

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

DAFDTDAFFDFTDADTDDFTTFDTATATFFFDFTTFFFTFDDTDAAFATDFTFDFDTTTDTTFDA


#4

@dankick

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.