We did three separate examples and Code39 gave us three different, unique barcodes (as we expected).
However, when we did it for OneCode, it gave us 3 of the same barcode. Are we doing something wrong or is there an issue with OneCode?
Examples are attached - Code39 is on top in all 3 examples and OneCode is on the bottom.
Hi Michael,
Thank you for contacting support. We have tested your sample PDFs against the latest builds of Aspose.BarCode 6.9.0 and Aspose.Pdf 10.3.0. We can read different Code39 barcodes whereas, in case of OneCode symbology, Aspose APIs returns same codes. It appears as these codes are also encoded with the same code text. Other online readers also read the same code text. Please check this sample code and results below:
[.NET, C#]
int pageIndex = 0;
// bind the pdf
PdfConverter converter = new PdfConverter();
converter.BindPdf(@"C:\temp\preview-57.pdf");
converter.RenderingOptions.BarcodeOptimization = true;
converter.DoConvert();
while (converter.HasNextImage())
{
pageIndex++;
MemoryStream pageStream = new MemoryStream();
converter.GetNextImage(pageStream, ImageFormat.Png);
using (BarCodeReader reader = new BarCodeReader(pageStream, BarCodeReadType.Code39Standard| BarCodeReadType.Code93Extended| BarCodeReadType.OneCode))
{
reader.ImageBinarizationHints = RecognitionHints.ImageBinarization.MedianSmoothing;
while (reader.Read())
{
Console.WriteLine("Page#" + pageIndex + " Code Text: " + reader.GetCodeText() + " Type: " + reader.GetReadType());
}
}
}
Results:
File Name: preview-57.pdf
Page#1 Code Text: 01-F-2009A000842911 Type: Code39Standard
Page#1 Code Text: 01234567094987654321 Type: OneCode
File Name: preview-58.pdf
Page#1 Code Text: 01-D-2014A00000001 Type: Code39Standard
Page#1 Code Text: 01234567094987654321 Type: OneCode
We hope, this helps. Please feel free to reply us in case of any confusion or questions.