Hi,
I am using ZXing library to decode Qr codes in jpg images converted from pdf file. I found that some Qr codes decoded result were null. I set the option TryHarder to true, but didn't work.
Below is my code snippet:
Does anyone has problems described above and found the solutions? Any help would be appreciated.
Thanks
I am using ZXing library to decode Qr codes in jpg images converted from pdf file. I found that some Qr codes decoded result were null. I set the option TryHarder to true, but didn't work.
Below is my code snippet:
byte[] data = null;
using (FileStream fs = new FileStream(ImgList[idx], FileMode.Open))
{
data = new byte[fs.Length];
fs.Read(data, 0, data.Length);
}
Result res = null;
using (MemoryStream ms = new MemoryStream(data))
{
byte[] ImgByte = ms.ToArray();
using (Bitmap bmp = (Bitmap)System.Drawing.Image.FromStream(ms))
{
IBarcodeReader bCodeReader = new BarcodeReader();
bCodeReader.Options.TryHarder = true;
res = bCodeReader.Decode(bmp);
}
}
Also, some of the images contains more than one Qr codes, I tried QRCodeMultiReader code found here: TEXT, but only one Qr code was decoded and the rest were not decoded.Does anyone has problems described above and found the solutions? Any help would be appreciated.
Thanks