Search Results for

    Show / Hide Table of Contents

    Class BarcodeReaderOptions

    An Options class of BarcodeReader for reading many popular barcode formats from Images and PDFs.

    Inheritance
    System.Object
    BarcodeReaderOptions
    PdfBarcodeReaderOptions
    Namespace: IronBarCode
    Assembly: IronBarCode.dll
    Syntax
    public class BarcodeReaderOptions : Object

    When a read needs tuning for accuracy or speed, BarcodeReaderOptions carries the settings that steer it. Every BarcodeReader.Read and ReadAsync overload accepts one, so the same options object decides which symbologies to scan for, how hard to look, and how to handle awkward source images. Reaching for it is the answer to "barcode reading too slow in C#" or "IronBarcode not detecting barcode", since the defaults favor accuracy and most tuning happens here.

    A reader receives the options as an argument; construct one with new BarcodeReaderOptions(), set the properties a job needs, and pass it to a read call. PdfBarcodeReaderOptions derives from this class and adds the PDF-specific page, DPI, and password settings, so a PDF read configures the same base properties plus those extras. Leaving the argument out applies the defaults, which scan for all supported types at balanced speed.

    The properties group by purpose. Symbology selection is ExpectBarcodeTypes, a BarcodeEncoding value that limits the scan to the formats a job expects, and ExpectMultipleBarcodes, which keeps scanning after the first code is found instead of stopping early. Detection strategy is ScanMode, a BarcodeScanMode that chooses a basic pass or a machine-learning model, Speed, a ReadingSpeed that runs from Faster to ExtremeDetail and defaults to Balanced, and ConfidenceThreshold, the minimum machine-learning confidence in the range zero to one with a default of 0.7. Image handling is AutoRotate, ImageFilters, CropArea, and MinScanLines, which correct, filter, and bound the region scanned. Throughput is Multithreaded, MaxParallelThreads, and RemoveFalsePositive. The Code 39 specific UseCode39ExtendedMode enables the extended character set. Set only the properties a job needs and leave the rest at their defaults.

    using IronBarCode;
    
    var options = new BarcodeReaderOptions
    {
        ExpectBarcodeTypes = BarcodeEncoding.QRCode,
        Speed = ReadingSpeed.Faster,
        ExpectMultipleBarcodes = true
    };
    BarcodeResults results = BarcodeReader.Read("barcode.png", options);

    The reading speed options how-to tunes accuracy against throughput, the barcode reader settings example shows a configured read, and the read multiple barcodes how-to sets the multi-code option.

    Constructors

    BarcodeReaderOptions()

    Initializes a new instance of the BarcodeReader class.

    Declaration
    public BarcodeReaderOptions()

    Properties

    AutoRotate

    Toggle whether to automatically rotate barcodes or not in an ML detection. Default = true.

    Declaration
    public bool AutoRotate { get; set; }
    Property Value
    Type Description
    System.Boolean

    ConfidenceThreshold

    Minimum confidence level for ML model detection to be considered valid. The value is between (0.0, 1.0). Default value is 0.7

    Declaration
    public double ConfidenceThreshold { get; set; }
    Property Value
    Type Description
    System.Double

    CropArea

    The area of each image frame in which to scan for barcodes. A IronSoftware.Drawing.Rectangle measured in pixels.

    Declaration
    public Rectangle CropArea { get; set; }
    Property Value
    Type Description
    IronSoftware.Drawing.Rectangle

    ExpectBarcodeTypes

    The barcode encoding types to read from the InputImage. By default all supported barcodes types are scanned for.

    Declaration
    public BarcodeEncoding ExpectBarcodeTypes { get; set; }
    Property Value
    Type Description
    BarcodeEncoding

    ExpectMultipleBarcodes

    If set to false the barcode reader will stop scanning a given image once a barcode has been found to increase performance. Default = true.

    Declaration
    public bool ExpectMultipleBarcodes { get; set; }
    Property Value
    Type Description
    System.Boolean

    ImageFilters

    A collection of image filters for image pre-processing.

    Declaration
    public ImageFilterCollection ImageFilters { get; set; }
    Property Value
    Type Description
    ImageFilterCollection

    MaxParallelThreads

    Max Threads for parallel. Default 4

    Declaration
    public int MaxParallelThreads { get; set; }
    Property Value
    Type Description
    System.Int32

    MinScanLines

    The minimum number of scan-lines that must agree on a barcode result for it to be considered valid.

    Increasing this reduces false positives (misreads) but may prevent detection of thin or low-quality barcodes.

    Decreasing this (e.g. to 1) increases sensitivity for difficult barcodes but may introduce noise.

    Default is 2.

    Declaration
    public int MinScanLines { get; set; }
    Property Value
    Type Description
    System.Int32

    A value greater than or equal to 1.

    Multithreaded

    Reads barcodes from multiple images in parallel. Multiple threads will automatically be started and managed to improve performance for batch barcode reading tasks.

    Declaration
    public bool Multithreaded { get; set; }
    Property Value
    Type Description
    System.Boolean

    RemoveFalsePositive

    Attempt to remove false positive barcode reads. This can be disabled to improve performance at the cost of accuracy. Default = true.

    Declaration
    public bool RemoveFalsePositive { get; set; }
    Property Value
    Type Description
    System.Boolean

    ScanMode

    Define how IronBarcode scans and detects barcodes in an image to read.

    Declaration
    public BarcodeScanMode ScanMode { get; set; }
    Property Value
    Type Description
    BarcodeScanMode

    Speed

    Barcode reading speed. Default = Balanced.

    Declaration
    public ReadingSpeed Speed { get; set; }
    Property Value
    Type Description
    ReadingSpeed

    UseCode39ExtendedMode

    If a Code39 barcode is detected, use the extended mode for the full ASCII character set.

    Declaration
    public bool UseCode39ExtendedMode { get; set; }
    Property Value
    Type Description
    System.Boolean
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    %s requires a valid license key for further deployment. Get Trial Below.
    ironsuite
    Blue key in circleGet Started for Free
    30 days full access • No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet Started for Free
    The trial form was submitted successfully.
    Grey check in circleTrial key delivered
    Your key has been issued and sent to your email.
    Calendar in circleBook Free Live Demo
    No cards • no pitches • no commitments Pick a time for a quick, personalized demo
    Get the most out of your 30-day trial with:

    Live product and key features walk-through

    Project-specific recommendations

    All your questions answered

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation

    Want to deploy Iron Suite
    to a live project for FREE?

    What’s included?

    • Test in production without watermarks
    • 30 days fully functional product
    • 24/5 technical support during trial
    ironpdf Logo
    ironword Logo
    ironxl Logo
    ironppt Logo
    ironocr Logo
    ironbarcode Logo
    ironqr Logo
    ironprint Logo
    ironzip Logo
    ironwebscraper Logo
    Iron Software sales team
    Online 24/5
    Have Enterprise licensing requirements?
    Request Iron Suite Enterprise trial
    Key in blue circle

    Get your free 30-day Trial Key instantly

    Your trial license will be sent to your email address

    No limitations. 100% unlocked. No credit card.

    bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
    Or
    Key in blue circle

    Complete Your Trial Key Signup

    Tell us a little more about yourself.

    Key in blue circleNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
    Key in blue circle

    Your license key has been delivered to your inbox

    Can't find it? Check your spam folder.

    What’s next?
    Install with NuGet
    Add IronBarcode to your project
    Quickstart Guide
    Helpful resources to get started

    Need help getting started?

    Book a Free Live Demo

    See IronBarcode in action and get your licensing questions answered, or

    Key in blue circle

    Your demo request is in.

    You'll receive an invite via email shortly.

    What’s next?
    Explore Documentation
    Review Licensing Options
    badge_greencheck_in_yellowcircle
    Thank you
    Your trial key should be in the email.
    If it is not, please contact support@ironsoftware.com
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronBarcode
    Your trial key should be in the email.
    If it is not, please contact support@ironsoftware.com