public static void ReadMultipleFromPdf()
        {
            // Multiple barcodes may be scanned up from a single document or image.  A PDF document may also used as the input image
            PagedBarcodeResult[] PDFResults = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.None);

            // Work with the results
            foreach (var PageResult in PDFResults)
            {
                string Value                      = PageResult.Value;
                int    PageNum                    = PageResult.PageNumber;
                System.Drawing.Bitmap Img         = PageResult.BarcodeImage;
                BarcodeEncoding       BarcodeType = PageResult.BarcodeType;
                byte[] Binary                     = PageResult.BinaryValue;
                Console.WriteLine(PageResult.Value + " on page " + PageNum);
            }
        }
Example #2
0
        public static void ReadScanPDF()
        {
            // Best Results with a 200-300 DPI Scan.  Specify a barcode format to avoid false positives in digital noise and text.
            // Multi frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
            var ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.Code128 | BarcodeEncoding.ITF, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels);

            // Work with the results
            foreach (var PageResult in ScanResults)
            {
                string Value                      = PageResult.Value;
                int    PageNum                    = PageResult.PageNumber;
                System.Drawing.Bitmap Img         = PageResult.BarcodeImage;
                BarcodeEncoding       BarcodeType = PageResult.BarcodeType;
                byte[] Binary                     = PageResult.BinaryValue;
                Console.WriteLine(PageResult.Value + " on page " + PageNum);
            }
        }