Search Results for

    Show / Hide Table of Contents

    Class TesseractConfiguration

    A configuration object that fine-tunes Tesseract behavior at an Instance level. Gives access to every option available to tesseract command line or C++ API users.

    Inheritance
    System.Object
    TesseractConfiguration
    Implements
    System.ICloneable
    Namespace: IronOcr
    Assembly: IronOcr.dll
    Syntax
    public class TesseractConfiguration : Object, ICloneable

    Constructors

    TesseractConfiguration()

    Declaration
    public TesseractConfiguration()

    Fields

    EngineMode

    Allows the developer to choose the algorithm Tesseract will use for OCR. TesseractAndLstm is the recommended behavior for IronOCR.

    Declaration
    public TesseractEngineMode EngineMode
    Field Value
    Type Description
    TesseractEngineMode

    PageSegmentationMode

    Determines how a page is scanned to find potential blocks of text. Best documented in Tesseract developer websites.

    AutoOsd is a safe default.

    Declaration
    public TesseractPageSegmentationMode PageSegmentationMode
    Field Value
    Type Description
    TesseractPageSegmentationMode

    ReadBarCodes

    Optionally turns on Barcode reading alongside OCR.

    Declaration
    public bool ReadBarCodes
    Field Value
    Type Description
    System.Boolean

    ReadDataTables

    Optionally turns on Table Detection and Parsing. To see tables in the OcrResult, access the Tables property.

    var result = Ocr.Read(ocrInput);
    result.Tables; // Output tables
    Declaration
    public bool ReadDataTables
    Field Value
    Type Description
    System.Boolean

    RenderHocr

    Prerenders HOCR files during Tesseract read operations. Required True to use SaveAsHocrFile(String) method.

    Declaration
    public bool RenderHocr
    Field Value
    Type Description
    System.Boolean

    RenderSearchablePdf

    Enables the creation of a Searchable PDF of the OcrInput in memory during Tesseract read operations. Must be True to save as Searachable PDF. methods.

    Declaration
    public bool RenderSearchablePdf
    Field Value
    Type Description
    System.Boolean

    TesseractVariables

    Add Tesseract configuration variables of type bool, int, double or string. Gives access to all Tesseract command-line and config file options.

    To learn how to use this, Tesseract documentation is very sparse. Please use TrySaveAllTesseractVariablesToFile(String) to output all available tesseract variables for your installation of Tesseract.

    To learn more about how to use TesseractVariables see our guide at: https://ironsoftware.com/csharp/ocr/docs/questions/csharp-tesseract-config-configuration-variables/

    Declaration
    public Dictionary<string, object> TesseractVariables
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>

    TesseractVersion

    IronOcr supports Tesseract 5.1

    Declaration
    public TesseractVersion TesseractVersion
    Field Value
    Type Description
    TesseractVersion

    Properties

    BlackListCharacters

    If set, any characters in this string will not be recognized by IronTesseract OCR. An example use-case is to remove characters with accents.

    BlackListCharacters and WhiteListCharacters can positively impact speed and accuracy if set thoughtfully.

    Declaration
    public string BlackListCharacters { get; set; }
    Property Value
    Type Description
    System.String
    See Also
    WhiteListCharacters

    WhiteListCharacters

    If set, only characters in this string will be read by IronTesseract. Remember to include punctuation marks and space characters.

    If know, WhiteListCharacters can dramatically increase performance and accuracy.

    Also very useful if we expect only numbers or only letters.

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

    Methods

    Clone()

    Clone this See TesseractConfiguration

    Declaration
    public object Clone()
    Returns
    Type Description
    System.Object

    A copy of this TesseractConfiguration as an object.

    TrySaveAllTesseractVariablesToFile(String)

    Saves all Tesseract internal settings for this Configuration to a plain text file.

    Declaration
    public bool TrySaveAllTesseractVariablesToFile(string Path)
    Parameters
    Type Name Description
    System.String Path

    A valid file path. Recommended file extension is .txt

    Returns
    Type Description
    System.Boolean

    True if file successfully saved

    Implements

    System.ICloneable
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    IronOCR_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 IronOCR