I'm using GdPicture.NET rel. 8.3.0.5.
My application contains a GdViewer control, where I can drag a file from file system.
When I drop the file, I load the file, then detect a possible barcode and show the document in the control.
During barcode detecting, I encounter very low performances when I load a PDF file.
With barcode detection elapsed time is 26 seconds.
Commenting the detection call the time decreases drastically to 2 seconds.
This is my C# code snippet of Detect method:
Code: Select all
//------------------------------------------------------------------------------------
private List<string> DetectBarcodeInPDFFile(string pdfPath)
{
List<string> bCodes = new List<string>();
if (gdPDF.LoadFromFile(pdfPath, false) == GdPictureStatus.OK)
{
for (int i = 1; i <= gdPDF.GetPageCount(); i++)
{
// select current page
if (gdPDF.SelectPage(i))
{
// extract image
int imageId = gdPDF.RenderPageToGdPictureImage(200, false);
if (imageId > 0)
{
// search barcode in j-th page
if (gdPicture.Barcode1DReaderDoScan(imageId, Barcode1DReaderScanMode.BestQuality) == GdPictureStatus.OK)
{
// per ogni barcode individuato memorizzo le sue informazioni
for (int j = 1; j <= gdPicture.Barcode1DReaderGetBarcodeCount(); j++)
bCodes.Add(gdPicture.Barcode1DReaderGetBarcodeValue(j));
}
// I release the memory
gdPicture.Barcode1DReaderClear();
gdPicture.ReleaseGdPictureImage(imageId);
}
}
}
gdPDF.CloseDocument();
}
return bCodes;
}
Probably something is wrong in my code, otherwise there is another way to improve this operation?
Thanks in advance.
Michela