Can you see if I'm doing something wrong with PDF417 recognition?
I'm sending you the sample image in the attachment.
The thing is that this image is successfully recognized as a PDF417 barcode with other software, but I would like to use gdpicture components...
This is the code I'm using:
Code: Select all
string _hubFilePath = @"C:\Pictures\P0018.tiff";
try
{
using (GdPicture10.GdPictureImaging oGdPictureImaging = new GdPicture10.GdPictureImaging())
{
int ImageID = oGdPictureImaging.CreateGdPictureImageFromFile(_hubFilePath);
if (ImageID != 0)
{
try
{
string[] scanResult = null;
int barcodeCount = 0;
GdPicture10.GdPictureStatus status;
// PDF417
status = oGdPictureImaging.BarcodePDF417ReaderDoScan(ImageID, GdPicture10.BarcodePDF417ReaderScanMode.BestQuality, 1);
if (status != GdPicture10.GdPictureStatus.OK)
throw new ApplicationException("GDIPicture exception");
barcodeCount = oGdPictureImaging.BarcodePDF417ReaderGetBarcodeCount();
if (barcodeCount != 1)
throw new ApplicationException("Barcode not found");
scanResult = oGdPictureImaging.BarcodePDF417ReaderGetBarcodeValue(1);
}
finally
{
oGdPictureImaging.ReleaseGdPictureImage(ImageID);
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}