Hi.
I am trying to read some pages printed with PDF417 barcodes. Those barcodes were generated with version 5.4 of Aspose.Barcode.
We could not find a way to read them with the latest version of Aspose.Barcode or with version 5.4.
The problem is that we do not have the original data. We only have the printed sheets.
In topic 28751 I have put some comments and the Aspose support people have kindly told me to open a new thread.
I attach an image that cannot be read (generated with version 5.4) and one that can (generated with 2.5). I also indicate the code used to read. Although in reality we used physical readers.
Thanks a lot
Bad.jpg (364.4 KB)
Good.jpg (366.0 KB)
…
var barCodeLicense = new Aspose.BarCode.License();
barCodeLicense.SetLicense(xxxxxxxxxxxxxx\Aspose.Total.lic");
// Good
//var rutaOrigen = @"\xxxx\Imagenes\Good";
//var rutaDestino = @"xxxxx\Imagenes\Good\Good-trans-barcode-20.10.zip";
// Bad
var rutaOrigen = @"xxxxxx\Imagenes\Bad";
var rutaDestino = @"xxxx\Imagenes\Bad\Bad-trans-barcode-20.10.zip";
using (var writer = File.OpenWrite(rutaDestino))
{
var ficheroImagen = @"Bad.jpg";
var files = new DirectoryInfo(rutaOrigen).GetFiles(ficheroImagen, SearchOption.TopDirectoryOnly);
var encoding = Encoding.GetEncoding("ISO-8859-1");
foreach (var strFile in files.OrderBy(s => s.Name))
{
using (var reader = new BarCodeReader(strFile.FullName, DecodeType.MacroPdf417))
{
foreach (BarCodeResult result in reader.ReadBarCodes())
{
var data = encoding.GetBytes(result.CodeText);
writer.Write(data, 0, data.Length);
}
}
}
}
Note:
The code is also prepared to read the barcodes individually instead of in a single .jpg file