Class BarcodeReader
A versatile static class for reading many popular barcode formats from images and PDFs.
IronBarCode.BarcodeReader supports barcode reading from Bitmaps, image objects, image files, image streams, multi-frame TIFF images, and PDFs.
Features: Crop-area support, image filters, and pre-processing for improved accuracy, including the ability to automatically un-rotate, deskew and clean barcode image input.
Inheritance
Namespace: IronBarCode
Assembly: IronBarCode.dll
Syntax
public static class BarcodeReader : Object
Methods
Read(AnyBitmap, BarcodeReaderOptions)
Read barcodes from an image.
Overloads of this method accept the input image as IronSoftware.Drawing.AnyBitmap, as well as System.String file path, array of System.Byte and System.IO.Stream types.
Declaration
public static BarcodeResults Read(AnyBitmap inputImage, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IronSoftware.Drawing.AnyBitmap | inputImage | The input image as a IronSoftware.Drawing.AnyBitmap. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| BarcodeResults |
Read(Byte[], BarcodeReaderOptions)
Read barcodes from an image.
Overloads of this method accept the input image as an array of System.Byte, as well as IronSoftware.Drawing.AnyBitmap, System.String file paths and System.IO.Stream types.
Declaration
public static BarcodeResults Read(byte[] inputImage, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | inputImage | IEnumerable of Binary data of Image as a System.Byte array. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| BarcodeResults |
Read(IEnumerable<AnyBitmap>, BarcodeReaderOptions)
Read barcodes from multiple images.
Reading in parallel should be set by BarcodeReaderOptions.Multithreaded = true. If set to true, multiple threads will automatically be started and managed to improve performance for batch barcode reading tasks.
Overloads of this method accept the input images as an IEnumerable of System.String file paths as well as IronSoftware.Drawing.AnyBitmap, array of System.Byte and System.IO.Stream types.
Declaration
public static BarcodeResults Read(IEnumerable<AnyBitmap> inputImages, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<IronSoftware.Drawing.AnyBitmap> | inputImages | The input images as an IEnumerable of IronSoftware.Drawing.AnyBitmap. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| BarcodeResults | An Array of BarcodeResults. Array length will be zero if no barcodes were found. |
Read(IEnumerable<Byte[]>, BarcodeReaderOptions)
Read barcodes from multiple images.
Reading in parallel should be set by BarcodeReaderOptions.Multithreaded = true. If set to true, multiple threads will automatically be started and managed to improve performance for batch barcode reading tasks.
Overloads of this method accept the input images as an IEnumerable of array of System.Byte, as well as IronSoftware.Drawing.AnyBitmap, string file paths and System.IO.Stream types.
Declaration
public static BarcodeResults Read(IEnumerable<byte[]> inputImage, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Byte[]> | inputImage | IEnumerable of binary data of the image as a System.Byte array. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| BarcodeResults |
Read(IEnumerable<Stream>, BarcodeReaderOptions)
Read barcodes from multiple images.
Reading in parallel should be set by BarcodeReaderOptions.Multithreaded = true. If set to true, multiple threads will automatically be started and managed to improve performance for batch barcode reading tasks.
Overloads of this method accept the input images as an IEnumerable of System.IO.Stream, as well as IronSoftware.Drawing.AnyBitmap, array of System.Byte and System.String file path types.
Declaration
public static BarcodeResults Read(IEnumerable<Stream> inputImages, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.IO.Stream> | inputImages | The input images as an IEnumerable of System.IO.Stream. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| BarcodeResults |
Read(IEnumerable<String>, BarcodeReaderOptions)
Reads barcodes from multiple images.
Reading in parallel should be set by BarcodeReaderOptions.Multithreaded = true. If set to true, multiple threads will automatically be started and managed to improve performance for batch barcode reading tasks.
Overloads of this method accept the input images as an IEnumerable of System.String file paths, as well as IronSoftware.Drawing.AnyBitmap, array of System.Byte and System.IO.Stream types.
Declaration
public static BarcodeResults Read(IEnumerable<string> inputImages, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | inputImages | The input images as an IEnumerable of string file paths. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| BarcodeResults |
Read(Stream, BarcodeReaderOptions)
Read barcodes from an image.
Overloads of this method accept the input image as System.IO.Stream, as well as IronSoftware.Drawing.AnyBitmap, array of System.Byte and System.String file path types.
Declaration
public static BarcodeResults Read(Stream inputImage, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | inputImage | The input image as a System.IO.Stream. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| BarcodeResults |
Read(String, BarcodeReaderOptions)
Read barcodes from an image.
Overloads of this method accept the input image as a System.String file path, as well as IronSoftware.Drawing.AnyBitmap, array of System.Byte and System.IO.Stream types.
Declaration
public static BarcodeResults Read(string inputImage, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | inputImage | Filepath to the image. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| BarcodeResults |
ReadAsync(AnyBitmap, BarcodeReaderOptions)
Read barcodes from an image asynchronously.
Declaration
public static Task<BarcodeResults> ReadAsync(AnyBitmap inputImage, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IronSoftware.Drawing.AnyBitmap | inputImage | The input image as an IronSoftware.Drawing.AnyBitmap. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<BarcodeResults> |
ReadAsync(Byte[], BarcodeReaderOptions)
Reads barcodes from an image.
Binary data of the image as a System.Byte array. JPEG, PNG, BMP, TIFF & GIF image formats are supported.An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior.Declaration
public static Task<BarcodeResults> ReadAsync(byte[] inputImage, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | inputImage | |
| BarcodeReaderOptions | barcodeReaderOptions |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<BarcodeResults> |
ReadAsync(IEnumerable<AnyBitmap>, BarcodeReaderOptions)
Read barcodes from multiple images asynchronously.
Declaration
public static Task<BarcodeResults> ReadAsync(IEnumerable<AnyBitmap> inputImages, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<IronSoftware.Drawing.AnyBitmap> | inputImages | The input images as an IEnumerable of IronSoftware.Drawing.AnyBitmap. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<BarcodeResults> |
ReadAsync(IEnumerable<Byte[]>, BarcodeReaderOptions)
Reads barcodes from multiple images asynchronously.
Overloads of this method accept the input images as an IEnumerable of System.Byte arrays, as well as IronSoftware.Drawing.AnyBitmap, string file paths and System.IO.Stream types.
IEnumerable of binary data of the image as a System.Byte array. JPEG, PNG, BMP, TIFF & GIF image formats are supported.An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior.Declaration
public static Task<BarcodeResults> ReadAsync(IEnumerable<byte[]> inputImages, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Byte[]> | inputImages | |
| BarcodeReaderOptions | barcodeReaderOptions |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<BarcodeResults> |
ReadAsync(IEnumerable<Stream>, BarcodeReaderOptions)
Reads barcodes from multiple images in parallel. Multiple threads will automatically be started and managed to improve performance for batch barcode reading tasks.
Overloads of this method accept an IEnumerable of System.IO.Stream as well as IronSoftware.Drawing.AnyBitmap, array of System.Byte and System.String file path types.
Declaration
public static Task<BarcodeResults> ReadAsync(IEnumerable<Stream> inputImages, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.IO.Stream> | inputImages | The input images as an IEnumerable of System.IO.Stream. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<BarcodeResults> |
ReadAsync(IEnumerable<String>, BarcodeReaderOptions)
Read barcodes from multiple images asynchronously.
Overloads of this method accept the input images as an IEnumerable of System.String file paths as well as IronSoftware.Drawing.AnyBitmap, array of System.Byte and System.IO.Stream types.
Declaration
public static Task<BarcodeResults> ReadAsync(IEnumerable<string> inputImages, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | inputImages | The input images as an IEnumerable of System.String file paths. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<BarcodeResults> |
ReadAsync(Stream, BarcodeReaderOptions)
Reads barcodes from an image.
Declaration
public static Task<BarcodeResults> ReadAsync(Stream inputImage, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | inputImage | The input image as a System.IO.Stream. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<BarcodeResults> |
ReadAsync(String, BarcodeReaderOptions)
Read barcodes from an image asynchronously.
Declaration
public static Task<BarcodeResults> ReadAsync(string inputImage, BarcodeReaderOptions barcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | inputImage | The input image file paths. JPEG, PNG, BMP, TIFF & GIF image formats are supported. |
| BarcodeReaderOptions | barcodeReaderOptions | An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs in expected behavior. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<BarcodeResults> |
ReadPdf(Byte[], PdfBarcodeReaderOptions)
Read barcodes from every page of a PDF document.
Overloads of this method accept the PDF data as an array of System.Byte, as well as System.String path and System.IO.Stream types.
Declaration
public static BarcodeResults ReadPdf(byte[] pdfData, PdfBarcodeReaderOptions pdfBarcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | pdfData | Binary data of the PDF document as a System.Byte array. |
| PdfBarcodeReaderOptions | pdfBarcodeReaderOptions | An Options class of PdfBarcodeReader for reading barcodes from a PDF. |
Returns
| Type | Description |
|---|---|
| BarcodeResults |
ReadPdf(Stream, PdfBarcodeReaderOptions)
Read barcodes from every page of a PDF document.
Overloads of this method accept the PDF data as a System.IO.Stream, as well as System.Byte array and System.String file path types.
Declaration
public static BarcodeResults ReadPdf(Stream pdfStream, PdfBarcodeReaderOptions pdfBarcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | pdfStream | Binary data of a PDF document as a System.IO.Stream. |
| PdfBarcodeReaderOptions | pdfBarcodeReaderOptions | An Options class of PdfBarcodeReader for reading barcodes from a PDF. |
Returns
| Type | Description |
|---|---|
| BarcodeResults |
ReadPdf(String, PdfBarcodeReaderOptions)
Read barcodes from every page of a PDF document.
Overloads of this method accept the PDF data as a System.String file path, as well as System.Byte array and System.IO.Stream types.
Declaration
public static BarcodeResults ReadPdf(string pdfPath, PdfBarcodeReaderOptions pdfBarcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | pdfPath | System.String file path to a PDF document. |
| PdfBarcodeReaderOptions | pdfBarcodeReaderOptions | An Options class of PdfBarcodeReader for reading barcodes from a PDF. |
Returns
| Type | Description |
|---|---|
| BarcodeResults |
ReadPdfs(IEnumerable<Byte[]>, PdfBarcodeReaderOptions)
Read barcodes from multiple PDFs.
Overloads of this method accept the PDF data as an IEnumerable of System.Byte arrays, as well as System.String path and System.IO.Stream types.
Declaration
public static List<BarcodeResults> ReadPdfs(IEnumerable<byte[]> pdfData, PdfBarcodeReaderOptions pdfBarcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Byte[]> | pdfData | An IEnumerable of PDF document binary data as System.Byte arrays. |
| PdfBarcodeReaderOptions | pdfBarcodeReaderOptions | An Options class of PdfBarcodeReader for reading barcodes from PDFs. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<BarcodeResults> | A BarcodeResults for each PDF document. |
ReadPdfs(IEnumerable<Stream>, PdfBarcodeReaderOptions)
Read barcodes from multiple PDFs.
Overloads of this method accept the PDF data as an IEnumerable of System.IO.Stream as well as System.Byte array and System.String file path types.
Declaration
public static List<BarcodeResults> ReadPdfs(IEnumerable<Stream> pdfStreams, PdfBarcodeReaderOptions pdfBarcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.IO.Stream> | pdfStreams | An IEnumerable of PDF document binary data as a System.IO.Stream. |
| PdfBarcodeReaderOptions | pdfBarcodeReaderOptions | An Options class of PdfBarcodeReader for reading barcodes from PDFs. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<BarcodeResults> | A BarcodeResults for each PDF document. |
ReadPdfs(IEnumerable<String>, PdfBarcodeReaderOptions)
Read barcodes from multiple PDFs.
Overloads of this method accept the PDF data as an IEnumerable of System.String file paths, as well as System.Byte array and System.IO.Stream types.
Declaration
public static List<BarcodeResults> ReadPdfs(IEnumerable<string> pdfPaths, PdfBarcodeReaderOptions pdfBarcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | pdfPaths | An IEnumerable of System.String file paths to a PDF documents. |
| PdfBarcodeReaderOptions | pdfBarcodeReaderOptions | An Options class of PdfBarcodeReader for reading barcodes from PDFs. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<BarcodeResults> | A List of BarcodeResults for each PDF document. |
ReadPdfsAsync(IEnumerable<Byte[]>, PdfBarcodeReaderOptions)
Read barcodes from multiple PDFs asynchronously.
Overloads of this method accept the PDF data as an IEnumerable of System.Byte arrays, as well as System.String path and System.IO.Stream types.
Declaration
public static Task<List<BarcodeResults>> ReadPdfsAsync(IEnumerable<byte[]> pdfData, PdfBarcodeReaderOptions pdfBarcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Byte[]> | pdfData | An IEnumerable of PDF document binary data as System.Byte arrays. |
| PdfBarcodeReaderOptions | pdfBarcodeReaderOptions | An Options class of PdfBarcodeReader for reading barcodes from PDFs. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.List<BarcodeResults>> | A BarcodeResults for each PDF document. |
ReadPdfsAsync(IEnumerable<Stream>, PdfBarcodeReaderOptions)
Read barcodes from multiple PDFs asynchronously.
Overloads of this method accept PDF data as an IEnumerable of System.IO.Stream, as well as System.Byte array and System.String file path types.
Declaration
public static Task<List<BarcodeResults>> ReadPdfsAsync(IEnumerable<Stream> pdfStreams, PdfBarcodeReaderOptions pdfBarcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.IO.Stream> | pdfStreams | An IEnumerable of PDF document binary data as a System.IO.Stream. |
| PdfBarcodeReaderOptions | pdfBarcodeReaderOptions | An Options class of PdfBarcodeReader for reading barcodes from PDFs. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.List<BarcodeResults>> | A BarcodeResults for each PDF document |
ReadPdfsAsync(IEnumerable<String>, PdfBarcodeReaderOptions)
Read barcodes from multiple PDFs asynchronously.
Overloads of this method accept PDF data as an IEnumerable of System.String file paths, as well as System.Byte array and System.IO.Stream types.
Declaration
public static Task<List<BarcodeResults>> ReadPdfsAsync(IEnumerable<string> pdfPaths, PdfBarcodeReaderOptions pdfBarcodeReaderOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | pdfPaths | An IEnumerable of System.String file paths to PDF documents. |
| PdfBarcodeReaderOptions | pdfBarcodeReaderOptions | An Options class of PdfBarcodeReader for reading barcodes from PDFs. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.List<BarcodeResults>> | A BarcodeResults for each PDF document |