Search Results for

    Show / Hide Table of Contents

    Class OcrPdfInput

    OCR input based on PDF data

    Inheritance
    System.Object
    OcrInputBase
    OcrPdfInput
    Implements
    System.IDisposable
    Inherited Members
    OcrInputBase.Finalize()
    OcrInputBase.Dispose()
    OcrInputBase.SaveAsImages(String, AnyBitmap.ImageFormat)
    OcrInputBase.HighlightTextAndSaveAsImages(IronTesseract, String, ResultHighlightType)
    OcrInputBase.FindTextRegion()
    OcrInputBase.FindMultipleTextRegions()
    OcrInputBase.StampCropRectanglesAndSaveAs(Rectangle[], Color, String, AnyBitmap.ImageFormat)
    OcrInputBase.StampCropRectangleAndSaveAs(Rectangle, Color, String, AnyBitmap.ImageFormat)
    OcrInputBase.StampCropRectangle(OcrInput, Rectangle, Color)
    OcrInputBase.StampCropRectangles(OcrInput, Rectangle[], Color)
    OcrInputBase.ApplyMultipleFilters(OcrFilters, Double, Int32, Int32, Int32, Boolean, Nullable<Int32>)
    OcrInputBase.WithTitle(String)
    OcrInputBase.Scale(Int32, Boolean)
    OcrInputBase.EnhanceResolution(Int32)
    OcrInputBase.AdaptiveThreshold(Nullable<Single>)
    OcrInputBase.Rotate(Double)
    OcrInputBase.Binarize()
    OcrInputBase.ToGrayScale()
    OcrInputBase.Sharpen()
    OcrInputBase.ReplaceColor(Color, Color, Int32)
    OcrInputBase.SelectTextColor(Color, Int32)
    OcrInputBase.SelectTextColors(IEnumerable<Color>, Int32)
    OcrInputBase.Contrast(Single)
    OcrInputBase.DeNoise(Boolean)
    OcrInputBase.DeNoise(Boolean, Boolean)
    OcrInputBase.Despeckle(Boolean)
    OcrInputBase.Despeckle(Boolean, Boolean)
    OcrInputBase.Invert(Boolean)
    OcrInputBase.Erode(Boolean)
    OcrInputBase.Open(Boolean)
    OcrInputBase.Close(Boolean)
    OcrInputBase.HoughTransformStraighten(Int32)
    OcrInputBase.Deskew(Int32)
    OcrInputBase.DetectPageOrientation(OrientationDetectionMode)
    OcrInputBase.DetectPageOrientation(OrientationDetectionMode, Int32)
    OcrInputBase.Scale(Int32, Int32, Boolean)
    OcrInputBase.Dilate(Boolean)
    OcrInputBase.GetPages()
    OcrInputBase.RemovePages(IEnumerable<Int32>)
    OcrInputBase.RemovePage(Int32)
    OcrInputBase.PageCount()
    OcrInputBase.TargetDPI
    OcrInputBase.Title
    Namespace: IronOcr
    Assembly: IronOcr.dll
    Syntax
    public class OcrPdfInput : OcrInputBase

    Reach for OcrPdfInput to feed a PDF into an OCR read instead of an image. It wraps a PDF, by file path, byte array, stream, or an IDocumentId, so IronTesseract can recognize text across its pages the same way it reads a scan. It is the PDF-specific input alongside the image input types, and as an OcrInputBase it slots into the same Read call every other input uses.

    The constructors carry the options a PDF read needs. Each takes the source plus an optional Password for protected documents, a PdfContents value as OcrContent to choose whether to read embedded text, rendered pages, or both, a PageIndices sequence to limit the read to specific pages, and a ContentAreas array of rectangles to restrict recognition to regions of each page. The OcrContent property reports the content mode the input was built with. Because the type implements IDisposable, wrap it in a using so the document and its resources are released after the read.

    The input PDFs how-to covers reading from a PDF, and the searchable PDF example turns a read into a searchable document.

    Constructors

    OcrPdfInput(IDocumentId, PdfContents, IEnumerable<Int32>, Rectangle[])

    Create a new OCR input from the specified PDF data.

    Specify PdfContents.OnlyImages to OCR individual images within the PDF or PdfContents.TextAndImages to OCR the entire PDF.

    Declaration
    public OcrPdfInput(IDocumentId Document, PdfContents OcrContent, IEnumerable<int> PageIndices = null, Rectangle[] ContentAreas = null)
    Parameters
    Type Name Description
    IronSoftware.Abstractions.Pdf.IDocumentId Document

    PDF data

    PdfContents OcrContent

    OCR individual images within the PDF or OCR the entire PDF

    System.Collections.Generic.IEnumerable<System.Int32> PageIndices

    PDF pages to OCR

    IronSoftware.Drawing.Rectangle[] ContentAreas

    Area of each page to OCR (one for EACH page)

    OcrPdfInput(Byte[], String, PdfContents, IEnumerable<Int32>, Rectangle[])

    Create a new OCR input from the specified PDF data.

    Specify PdfContents.OnlyImages to OCR individual images within the PDF or PdfContents.TextAndImages to OCR the entire PDF.

    Declaration
    public OcrPdfInput(byte[] Bytes, string Password = null, PdfContents OcrContent, IEnumerable<int> PageIndices = null, Rectangle[] ContentAreas = null)
    Parameters
    Type Name Description
    System.Byte[] Bytes

    PDF data

    System.String Password

    PDF password

    PdfContents OcrContent

    OCR individual images within the PDF or OCR the entire PDF

    System.Collections.Generic.IEnumerable<System.Int32> PageIndices

    PDF pages to OCR

    IronSoftware.Drawing.Rectangle[] ContentAreas

    Area of each page to OCR (one for EACH page)

    OcrPdfInput(Stream, String, PdfContents, IEnumerable<Int32>, Rectangle[])

    Create a new OCR input from the specified PDF stream

    Specify PdfContents.OnlyImages to OCR individual images within the PDF or PdfContents.TextAndImages to OCR the entire PDF.

    Declaration
    public OcrPdfInput(Stream Stream, string Password = null, PdfContents OcrContent, IEnumerable<int> PageIndices = null, Rectangle[] ContentAreas = null)
    Parameters
    Type Name Description
    System.IO.Stream Stream

    PDF data stream

    System.String Password

    PDF password

    PdfContents OcrContent

    OCR individual images within the PDF or OCR the entire PDF

    System.Collections.Generic.IEnumerable<System.Int32> PageIndices

    PDF pages to OCR

    IronSoftware.Drawing.Rectangle[] ContentAreas

    Area of each page to OCR (one for EACH page)

    OcrPdfInput(String, String, PdfContents, IEnumerable<Int32>, Rectangle[])

    Create a new OCR input from the specified PDF file

    Specify PdfContents.OnlyImages to OCR individual images within the PDF or PdfContents.TextAndImages to OCR the entire PDF.

    Declaration
    public OcrPdfInput(string Path, string Password = null, PdfContents OcrContent, IEnumerable<int> PageIndices = null, Rectangle[] ContentAreas = null)
    Parameters
    Type Name Description
    System.String Path

    PDF file path

    System.String Password

    PDF password

    PdfContents OcrContent

    OCR individual images within the PDF or OCR the entire PDF

    System.Collections.Generic.IEnumerable<System.Int32> PageIndices

    PDF pages to OCR

    IronSoftware.Drawing.Rectangle[] ContentAreas

    Area of each page to OCR (one for EACH page)

    Properties

    OcrContent

    PDF content; determines what to OCR from within the PDF

    Declaration
    public PdfContents OcrContent { get; }
    Property Value
    Type Description
    PdfContents

    Implements

    System.IDisposable

    Inherited members

    Finalize()
    Dispose()
    SaveAsImages(String, AnyBitmap.ImageFormat)
    HighlightTextAndSaveAsImages(IronTesseract, String, ResultHighlightType)
    FindTextRegion()
    FindMultipleTextRegions()
    StampCropRectanglesAndSaveAs(Rectangle[], Color, String, AnyBitmap.ImageFormat)
    StampCropRectangleAndSaveAs(Rectangle, Color, String, AnyBitmap.ImageFormat)
    StampCropRectangle(OcrInput, Rectangle, Color)
    StampCropRectangles(OcrInput, Rectangle[], Color)
    ApplyMultipleFilters(OcrFilters, Double, Int32, Int32, Int32, Boolean, Nullable<Int32>)
    WithTitle(String)
    Scale(Int32, Boolean)
    EnhanceResolution(Int32)
    AdaptiveThreshold(Nullable<Single>)
    Rotate(Double)
    Binarize()
    ToGrayScale()
    Sharpen()
    ReplaceColor(Color, Color, Int32)
    SelectTextColor(Color, Int32)
    SelectTextColors(IEnumerable<Color>, Int32)
    Contrast(Single)
    DeNoise(Boolean)
    DeNoise(Boolean, Boolean)
    Despeckle(Boolean)
    Despeckle(Boolean, Boolean)
    Invert(Boolean)
    Erode(Boolean)
    Open(Boolean)
    Close(Boolean)
    HoughTransformStraighten(Int32)
    Deskew(Int32)
    DetectPageOrientation(OrientationDetectionMode)
    DetectPageOrientation(OrientationDetectionMode, Int32)
    Scale(Int32, Int32, Boolean)
    Dilate(Boolean)
    GetPages()
    RemovePages(IEnumerable<Int32>)
    RemovePage(Int32)
    PageCount()
    TargetDPI
    Title
    ☀
    ☾
    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 IronOCR to your project
    Quickstart Guide
    Helpful resources to get started

    Need help getting started?

    Book a Free Live Demo

    See IronOCR 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 IronOCR
    Your trial key should be in the email.
    If it is not, please contact support@ironsoftware.com