Hello,
I am using the PDF and Barcode libraries to read barcodes inside of PDF files. The performance is very slow. On a mixed Color and B&W PDF file of 171 pages, it takes 34 minutes to read about 11 barcodes. Below is the code (mostly same from the examples). Is there a more efficient way of doing this operation?
//open document
Document pdfDocument = new Document(file);
// bind the pdf document
PdfExtractor pdfExtractor = new PdfExtractor();
pdfExtractor.BindPdf(pdfDocument);
pdfExtractor.ExtractImage();
while (pdfExtractor.HasNextImage())
{
MemoryStream pageStream = new MemoryStream();
pdfExtractor.GetNextImage(pageStream, ImageFormat.Png);
Bitmap bm = new Bitmap(pageStream);
using (BarCodeReader reader = new BarCodeReader(bm,
new System.Drawing.Rectangle(25, 25, 1350, 860), BarCodeReadType.Pdf417))
{
reader.RecognitionMode = RecognitionMode.MaxPerformance;
while (reader.Read())
{
textBox1.AppendText(“Page#” + pageIndex + “Code test: \n” + reader.GetCodeText());
}
reader.Close();
}
}
Hi there,
Hi Tilal,
Attached is a sample. This file took around 8 minutes for 120 pages. The same file converted to B/W took 2 minutes. I believe its related to how many color pages there are in the file. In the attached there are 12, but the production could range a lot more.
Any advice is appreciated.
Thanks,
Hi there,
Would you please try using the latest version of the API i.e. 23.3 and if issue still persists, please share your sample document with us so that we can further proceed to assist you accordingly.