Search Results for

    Show / Hide Table of Contents

    Class PdfBarcodeReaderOptions

    An Options class of PdfBarcodeReaderOptions for reading many popular barcode formats from PDFs.

    Features: MaxParallelThreads, Reading detail, ExpectMultipleBarcodes, Crop-area, Image filters and preprocessing for improved accuracy.
    Inheritance
    System.Object
    BarcodeReaderOptions
    PdfBarcodeReaderOptions
    Inherited Members
    BarcodeReaderOptions.Speed
    BarcodeReaderOptions.ExpectMultipleBarcodes
    BarcodeReaderOptions.ExpectBarcodeTypes
    BarcodeReaderOptions.Multithreaded
    BarcodeReaderOptions.MaxParallelThreads
    BarcodeReaderOptions.CropArea
    BarcodeReaderOptions.UseCode39ExtendedMode
    BarcodeReaderOptions.RemoveFalsePositive
    BarcodeReaderOptions.ImageFilters
    BarcodeReaderOptions.ScanMode
    BarcodeReaderOptions.ConfidenceThreshold
    BarcodeReaderOptions.AutoRotate
    BarcodeReaderOptions.MinScanLines
    Namespace: IronBarCode
    Assembly: IronBarCode.dll
    Syntax
    public class PdfBarcodeReaderOptions : BarcodeReaderOptions

    Page selection, rendering resolution, and password handling for reading barcodes out of a PDF live on PdfBarcodeReaderOptions. It is the argument a developer passes to BarcodeReader.ReadPdf, ReadPdfs, and ReadPdfsAsync to point the reader at the right pages of a document and to open a protected file. This is the type behind a search like "read barcode from PDF C#" or "scan barcode in PDF page", and it answers the questions a plain image read cannot.

    PdfBarcodeReaderOptions derives from BarcodeReaderOptions, so it carries every base setting, the symbology, scan mode, speed, and image handling, and adds the PDF-only properties on top. A developer constructs one, sets the PDF-specific properties a job needs, and passes it to a ReadPdf overload that takes a path, byte array, or stream. Constructor overloads let a single page number or a sequence of page numbers be supplied up front.

    The PDF-specific properties are few and purposeful. PageNumbers is an IEnumerable<int> that restricts the read to chosen pages instead of scanning the whole document, which matters for large files. DPI sets the resolution each page is rendered at before scanning, and Scale adjusts the rendered page size; raising either helps small or dense codes resolve at the cost of speed. Password opens an encrypted PDF so its pages can be rendered and read. Because the base properties still apply, a PDF read can also set ExpectBarcodeTypes, Speed, and the rest exactly as an image read would. Leave the PDF properties at their defaults to scan every page at the standard resolution.

    using IronBarCode;
    
    var options = new PdfBarcodeReaderOptions
    {
        PageNumbers = new[] { 1, 2 },
        DPI = 150,
        Password = "secret"
    };
    BarcodeResults results = BarcodeReader.ReadPdf("invoice.pdf", options);

    The read barcodes from PDF how-to walks through a document read, the PDF barcode reader settings example shows the configured options, and the reading barcodes tutorial covers the wider workflow.

    Constructors

    PdfBarcodeReaderOptions()

    Initializes a new instance of the PdfBarcodeReaderOptions class.

    Declaration
    public PdfBarcodeReaderOptions()

    PdfBarcodeReaderOptions(IEnumerable<Int32>)

    Initializes a new instance of the PdfBarcodeReaderOptions class with the specified pages.

    Declaration
    public PdfBarcodeReaderOptions(IEnumerable<int> pageNumbers)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Int32> pageNumbers

    The page numbers of the PDF.

    PdfBarcodeReaderOptions(Int32)

    Initializes a new instance of the PdfBarcodeReaderOptions class with the specified page.

    Declaration
    public PdfBarcodeReaderOptions(int pageNumber)
    Parameters
    Type Name Description
    System.Int32 pageNumber

    The page number of the PDF.

    Properties

    DPI

    The Dots per inch to rendering each Barcode images.

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

    PageNumbers

    The page numbers of the PDF to read expressed as an Array, List or IEnumerable of System.Int32. PageNumbers are '1 based' meaning that the first page number is 1 rather than zero.

    Declaration
    public IEnumerable<int> PageNumbers { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<System.Int32>

    Password

    The password string to open / unencrypt the PDF. Null or "" assign no password.

    Declaration
    public string Password { get; set; }
    Property Value
    Type Description
    System.String

    Scale

    The Scale Factor for Scaling Width and Height when convert Pdf to Image. Default 3.5.

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

    Inherited members

    Speed
    ExpectMultipleBarcodes
    ExpectBarcodeTypes
    Multithreaded
    MaxParallelThreads
    CropArea
    UseCode39ExtendedMode
    RemoveFalsePositive
    ImageFilters
    ScanMode
    ConfidenceThreshold
    AutoRotate
    MinScanLines
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    IronBarcode_for_dotnet_log2o
    Blue key in circleGet started for FREE
    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.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronBarcode