PDF417 recognition won't work
Posted: Mon Apr 29, 2013 2:30 pm
Hi, I created a sample using GdPicutre 9.4 version, where I open empty .pdf, create 4 BarCodes (1d, QR, PDF417 & DataMatrix), save the file and then try to process it through BarCode recognition.
However, I am only able to read 1D and QR codes, PDF417 & DataMatrix cannot be found. The project is in C#, here is a sample how i try to find any codes..
And the same way for QR, 1D and DataMatrix, I then format the output and print it. For DataMatrix and PDF417, the temp_count stays at 0, even if they are clearly generated in the input file. When I tried other random online readers, they were able to read the barcodes and retrieve data successfully.
The code for BarCode generating is here, the same pattern is used for QR, 1D and DataMatrix with different EncodingMode enums and other parameters, but simmilar to this.:
If you can help me find any errors, I would be really glad. I attached the generated file to this post.
However, I am only able to read 1D and QR codes, PDF417 & DataMatrix cannot be found. The project is in C#, here is a sample how i try to find any codes..
Code: Select all
ImageID = Pdf.RenderPageToGdPictureImage(400, true);
status = GdPictureImaging.BarcodePDF417ReaderDoScan(ImageID, BarcodePDF417ReaderScanMode.BestQuality);
if (status == GdPictureStatus.OK)
{
temp_count = GdPictureImaging.BarcodePDF417ReaderGetBarcodeCount();
status = Pdf.GetStat();
for (int c = 1; c <= temp_count; c++)
{
string data = GdPictureImaging.BarcodePDF417ReaderGetBarcodeValue(c).ToString();
status = Pdf.GetStat();
// process data
}
The code for BarCode generating is here, the same pattern is used for QR, 1D and DataMatrix with different EncodingMode enums and other parameters, but simmilar to this.:
Code: Select all
else if (Placement[i].type == Barcode_Subtype.Barcode_PDF417)
{
BarcodePDF417EncodingMode EncodingMode = BarcodePDF417EncodingMode.BarcodePDF417EncodingModeText;
BarcodePDF417ErrorCorrectionLevel CorrectionLevel = BarcodePDF417ErrorCorrectionLevel.BarcodePDF417ErrorCorrectionLevelAuto;
status = pdf.DrawBarcodePDF417(Data, EncodingMode, CorrectionLevel, 30, 3, 4, 2, Placement[i].X, Placement[i].Y, System.Drawing.Color.Black);
}
If you can help me find any errors, I would be really glad. I attached the generated file to this post.