This project has moved and is read-only. For the latest updates, please go here.

Zxing barcode reader

Aug 25, 2016 at 9:22 PM
Their is a problem in Zxing barcode reader.I was trying to read the pdf417 barcode,it works good.But sometimes it returns NUll value.I tried another reader it works.
Sep 13, 2016 at 9:42 PM
zxing doesn't guarantee that every possible barcode would be decoded. It depends on the image quality.
Other readers are using other algorithms which could be better or not as the one of zxing.
Feel free to provide a patch to improve zxing.
Feb 15 at 3:42 PM
Hi every body,
It always happens that the image generated from a pdf files with barecode it is not recognized.
How can I solve ? I use rasterize to put pdf in more images, but even if I grow the dpi of image the zxing does not recognize the barcode, the result is null.

Can anyone help me ?
Feb 15 at 4:07 PM
Here is my code that sometimes hang and result is null:
                using (System.Drawing.Image img = rasterizer.GetPage(dpi, dpi, i))
                {
                    #region File Saved TO Directory
                    Stream stream = new MemoryStream();
                    //Logger.WriteLog(ELogLevel.INFO, String.Format("FiletoScan is: {0}", fileToScan), null);
                    try
                    {
                        img.Save(stream, ImageFormat.Jpeg);
                    }
                    catch (Exception ex)
                    {
                      Logger.WriteLog(ELogLevel.ERROR, String.Format("Error in saving stream jpg: {0}", fileToScan), ex);
                    }
                    #endregion

                    //ZIXING 
                    Result[] result = null;
                    try
                    {
                        result =DecodeStream(stream);
                        if (result != null)
                        {
                            foreach (Result item in result)
                            {
                                if (item != null && item.Text.Length == 24)
                                {
                                    Logger.WriteLog(ELogLevel.INFO, String.Format("Trovato by ZIXING nel DOCUMENTO Barcode: {0}", item.Text), null);
                                    results.Add(item);
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Logger.WriteLog(ELogLevel.ERROR, String.Format("Errore in scansione ZIXING stream: {0}", fileToScan), ex);
                    }
                    finally
                    {
                        stream.Close();
                        stream.Dispose();
                        img.Dispose();
                        GC.Collect();
                    }
                                 }
The decodestream uses the:
barcodeReader.Decode(image);

of the Zxing API

Can anyone tell me the solution ? if I increase the dpi of the resultant image, I have problem of OutOfMemory Exception.

Regrads.
Vittorio Morellini
Feb 25 at 12:37 PM
How does DecodeStream look? Please post the source code.
Can you provide a file with a sample image from rasterizer.GetPage(dpi, dpi, i)?