In the attached document we are not reading all barcodes. What we are reading is:
Barcode found: BA0693955^ILDSR ^RB^04/09/12 MILLER DISTRIBUTING LLC ^ - on page 1
Barcode found: BA0693955^CADEC ^RB^04/09/12 MILLER DISTRIBUTING LLC ^ - on page 2
Barcode found: BA0693955^BA4BATCH^RB^12-13^ - on page 5
Barcode found: BA0693955^BA1322 ^RB^12-13^ - on page 8
Barcode found: BA0693955^CMDS02 ^RB^04/09/12 MILLER DISTRIBUTING LLC ^ - on page 10
Barcode found: BA0693955^IMSCH ^RB^12-13^ - on page 11
Barcode found: BA0693955^NBABATCH^RB^12-13^ - on page 12
Barcode found: '? - on page 13
Barcode found: '? - on page 20
Barcode found: BA0693955^MCS90 ^RB^12-13^ - on page 24
The barcodes that should have been read are:
Barcode found: BA0693955^ILDSR ^RB^04/09/12 MILLER DISTRIBUTING LLC ^ - on page 1
Barcode found: BA0693955^CADEC ^RB^04/09/12 MILLER DISTRIBUTING LLC ^ - on page 2
Barcode found: BA0693955^BA4BATCH^RB^12-13^ - on page 5
Barcode found: BA0693955^BA1322 ^RB^12-13^ - on page 8
Barcode found: BA0693955^CMDS02 ^RB^04/09/12 MILLER DISTRIBUTING LLC ^ - on page 10
Barcode found: BA0693955^IMSCH ^RB^12-13^ - on page 11
Barcode found: BA0693955^NBABATCH^RB^12-13^ - on page 12
Barcode found: BA0693955^NBCBATCH^RB^12-13^ - on page 22
Barcode found: BA0693955^MCS90 ^RB^12-13^ - on page 24
The barcode on page 22 is not being read.
The following is the code that I am using
Document pdfDocument = new Document(filename);
int pageCount = pdfDocument.Pages.Count;
for (var page = 1; page <= pageCount; page++)
{
Aspose.Pdf.Facades.PdfConverter converter = new Aspose.Pdf.Facades.PdfConverter();
converter.BindPdf(filename);
converter.RenderingOptions.BarcodeOptimization = true;
converter.StartPage = page;
converter.EndPage = page;
converter.Resolution = new Aspose.Pdf.Devices.Resolution(300);
converter.DoConvert();
MemoryStream stream = new MemoryStream();
converter.GetNextImage(stream, ImageFormat.Png);
using (BarCodeReader barcodeReader = new BarCodeReader(stream, BarcodeData.BarcodeSymbology))
{
if (BarcodeData.VerifyChecksum)
barcodeReader.ChecksumValidation = BarcodeData.ChecksumValidate;
while (barcodeReader.Read())
{
barcodesByPage = new AsposeBarcodesByPage();
barcodesByPage.Barcode = barcodeReader.GetCodeText();
barcodesByPage.Page = page;
barcodesColl.Add(barcodesByPage);
}
}
converter.Close();
converter.Dispose();
}