using IronBarCode;BarcodeReaderOptions options = new BarcodeReaderOptions(){ // Choose which filters are to be applied (in order)ImageFilters = new ImageFilterCollection() { new AdaptiveThresholdFilter(), }, // Uses machine learning to auto rotate the barcodeAutoRotate = true,};// Read barcodeBarcodeResults results = BarcodeReader.Read("TryHarderQR.png", options);
using IronBarCode;
BarcodeReaderOptions options = new BarcodeReaderOptions()
{
// Choose which filters are to be applied (in order)
ImageFilters = new ImageFilterCollection() {
new AdaptiveThresholdFilter(),
},
// Uses machine learning to auto rotate the barcode
AutoRotate = true,
};
// Read barcode
BarcodeResults results = BarcodeReader.Read("TryHarderQR.png", options);
ImportsIronBarCodePrivate options As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection() From {New AdaptiveThresholdFilter()}, .AutoRotate = True}' Read barcodePrivate results AsBarcodeResults = BarcodeReader.Read("TryHarderQR.png", options)
Imports IronBarCode
Private options As New BarcodeReaderOptions() With {
.ImageFilters = New ImageFilterCollection() From {New AdaptiveThresholdFilter()},
.AutoRotate = True
}
' Read barcode
Private results As BarcodeResults = BarcodeReader.Read("TryHarderQR.png", options)
using IronBarCode;using System;// Multiple barcodes may be scanned up from a single document or image. A PDF document may also used as the input imageBarcodeResults results = BarcodeReader.ReadPdf("MultipleBarcodes.pdf");// Work with the resultsforeach (var pageResult in results){ stringValue = pageResult.Value; intPageNum = pageResult.PageNumber; System.Drawing.BitmapImg = pageResult.BarcodeImage; BarcodeEncodingBarcodeType = pageResult.BarcodeType; byte[] Binary = pageResult.BinaryValue;Console.WriteLine(pageResult.Value + " on page " + PageNum);}
using IronBarCode;
using System;
// Multiple barcodes may be scanned up from a single document or image. A PDF document may also used as the input image
BarcodeResults results = BarcodeReader.ReadPdf("MultipleBarcodes.pdf");
// Work with the results
foreach (var pageResult in results)
{
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);
}
ImportsIronBarCodeImportsSystem' Multiple barcodes may be scanned up from a single document or image. A PDF document may also used as the input imagePrivate results AsBarcodeResults = BarcodeReader.ReadPdf("MultipleBarcodes.pdf")' Work with the resultsFor Each pageResult In results DimValueAsString = pageResult.Value DimPageNumAsInteger = pageResult.PageNumber DimImgAsSystem.Drawing.Bitmap = pageResult.BarcodeImage DimBarcodeTypeAsBarcodeEncoding = pageResult.BarcodeType DimBinary() AsByte = pageResult.BinaryValueConsole.WriteLine(pageResult.Value & " on page " & PageNum)Next pageResult
Imports IronBarCode
Imports System
' Multiple barcodes may be scanned up from a single document or image. A PDF document may also used as the input image
Private results As BarcodeResults = BarcodeReader.ReadPdf("MultipleBarcodes.pdf")
' Work with the results
For Each pageResult In results
Dim Value As String = pageResult.Value
Dim PageNum As Integer = pageResult.PageNumber
Dim Img As System.Drawing.Bitmap = pageResult.BarcodeImage
Dim BarcodeType As BarcodeEncoding = pageResult.BarcodeType
Dim Binary() As Byte = pageResult.BinaryValue
Console.WriteLine(pageResult.Value & " on page " & PageNum)
Next pageResult
using IronBarCode;// Multi frame TIFF and GIF images can also be scannedBarcodeResults multiFrameResults = BarcodeReader.Read("Multiframe.tiff");foreach (var pageResult in multiFrameResults){ //...}
using IronBarCode;
// Multi frame TIFF and GIF images can also be scanned
BarcodeResults multiFrameResults = BarcodeReader.Read("Multiframe.tiff");
foreach (var pageResult in multiFrameResults)
{
//...
}
ImportsIronBarCode' Multi frame TIFF and GIF images can also be scannedPrivate multiFrameResults AsBarcodeResults = BarcodeReader.Read("Multiframe.tiff")For Each pageResult In multiFrameResults '...Next pageResult
Imports IronBarCode
' Multi frame TIFF and GIF images can also be scanned
Private multiFrameResults As BarcodeResults = BarcodeReader.Read("Multiframe.tiff")
For Each pageResult In multiFrameResults
'...
Next pageResult
using IronBarCode;// The Multithreaded property allows for faster barcode scanning across multiple images or PDFs. All threads are automatically managed by IronBarCode.varListOfDocuments = new[] { "image1.png", "image2.JPG", "image3.pdf" };BarcodeReaderOptions options = new BarcodeReaderOptions(){ // Enable multithreadingMultithreaded = true,};BarcodeResults batchResults = BarcodeReader.Read(ListOfDocuments, options);
using IronBarCode;
// The Multithreaded property allows for faster barcode scanning across multiple images or PDFs. All threads are automatically managed by IronBarCode.
var ListOfDocuments = new[] { "image1.png", "image2.JPG", "image3.pdf" };
BarcodeReaderOptions options = new BarcodeReaderOptions()
{
// Enable multithreading
Multithreaded = true,
};
BarcodeResults batchResults = BarcodeReader.Read(ListOfDocuments, options);
ImportsIronBarCode' The Multithreaded property allows for faster barcode scanning across multiple images or PDFs. All threads are automatically managed by IronBarCode.PrivateListOfDocuments = { "image1.png", "image2.JPG", "image3.pdf" }Private options As New BarcodeReaderOptions() With {.Multithreaded = True}Private batchResults AsBarcodeResults = BarcodeReader.Read(ListOfDocuments, options)
Imports IronBarCode
' The Multithreaded property allows for faster barcode scanning across multiple images or PDFs. All threads are automatically managed by IronBarCode.
Private ListOfDocuments = { "image1.png", "image2.JPG", "image3.pdf" }
Private options As New BarcodeReaderOptions() With {.Multithreaded = True}
Private batchResults As BarcodeResults = BarcodeReader.Read(ListOfDocuments, options)
using IronBarCode;// TIFF files are processed similarly to regular images// Each frame is scanned automaticallyBarcodeResults multiFrameResults = BarcodeReader.Read("Multiframe.tiff");foreach (var result in multiFrameResults){ // Access frame-specific information int frameNumber = result.PageNumber; // Frame number in TIFF string barcodeValue = result.Text;Console.WriteLine($"Frame {frameNumber}: {barcodeValue}"); // Save individual barcode images if needed result.BarcodeImage?.Save($"barcode_frame_{frameNumber}.png");}
using IronBarCode;
// TIFF files are processed similarly to regular images
// Each frame is scanned automatically
BarcodeResults multiFrameResults = BarcodeReader.Read("Multiframe.tiff");
foreach (var result in multiFrameResults)
{
// Access frame-specific information
int frameNumber = result.PageNumber; // Frame number in TIFF
string barcodeValue = result.Text;
Console.WriteLine($"Frame {frameNumber}: {barcodeValue}");
// Save individual barcode images if needed
result.BarcodeImage?.Save($"barcode_frame_{frameNumber}.png");
}
ImportsIronBarCode' TIFF files are processed similarly to regular images' Each frame is scanned automaticallyDim multiFrameResults AsBarcodeResults = BarcodeReader.Read("Multiframe.tiff")For Each result In multiFrameResults ' Access frame-specific information Dim frameNumber AsInteger = result.PageNumber' Frame number in TIFF Dim barcodeValue AsString = result.TextConsole.WriteLine($"Frame {frameNumber}: {barcodeValue}") ' Save individual barcode images if needed result.BarcodeImage?.Save($"barcode_frame_{frameNumber}.png")Next
Imports IronBarCode
' TIFF files are processed similarly to regular images
' Each frame is scanned automatically
Dim multiFrameResults As BarcodeResults = BarcodeReader.Read("Multiframe.tiff")
For Each result In multiFrameResults
' Access frame-specific information
Dim frameNumber As Integer = result.PageNumber ' Frame number in TIFF
Dim barcodeValue As String = result.Text
Console.WriteLine($"Frame {frameNumber}: {barcodeValue}")
' Save individual barcode images if needed
result.BarcodeImage?.Save($"barcode_frame_{frameNumber}.png")
Next
using IronBarCode;// List of documents to process - mix of formats supportedvar documentBatch = new[] { "invoice1.pdf", "shipping_label.png", "inventory_sheet.tiff", "product_catalog.pdf"};// Configure for batch processingBarcodeReaderOptions batchOptions = new BarcodeReaderOptions{ // Enable parallel processing across documentsMultithreaded = true, // Limit threads if needed (0 = use all cores)MaxParallelThreads = Environment.ProcessorCount, // Apply consistent settings to all documentsSpeed = ReadingSpeed.Balanced,ExpectBarcodeTypes = BarcodeEncoding.All};// Process each document, tracking the source path externallyforeach (var document in documentBatch){ BarcodeResults results = BarcodeReader.Read(document, batchOptions);Console.WriteLine($"\nDocument: {document}"); foreach (var barcode in results) {Console.WriteLine($" - {barcode.BarcodeType}: {barcode.Text}"); }}
using IronBarCode;
// List of documents to process - mix of formats supported
var documentBatch = new[]
{
"invoice1.pdf",
"shipping_label.png",
"inventory_sheet.tiff",
"product_catalog.pdf"
};
// Configure for batch processing
BarcodeReaderOptions batchOptions = new BarcodeReaderOptions
{
// Enable parallel processing across documents
Multithreaded = true,
// Limit threads if needed (0 = use all cores)
MaxParallelThreads = Environment.ProcessorCount,
// Apply consistent settings to all documents
Speed = ReadingSpeed.Balanced,
ExpectBarcodeTypes = BarcodeEncoding.All
};
// Process each document, tracking the source path externally
foreach (var document in documentBatch)
{
BarcodeResults results = BarcodeReader.Read(document, batchOptions);
Console.WriteLine($"\nDocument: {document}");
foreach (var barcode in results)
{
Console.WriteLine($" - {barcode.BarcodeType}: {barcode.Text}");
}
}