# TesseractOcr

Automatic local Tesseract discovery with reusable session support.

Class 

`OfficeIMO.Ocr.Tesseract`

**Namespace**

`OfficeIMO.Ocr.Tesseract`

**Assembly**

`OfficeIMO.Ocr.Tesseract`

**Source revision**

`063fe3ee9839` with working tree changes

**Source**

[TesseractOcr.cs:6](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr.Tesseract/TesseractOcr.cs#L6)

**Modifiers**

static

Automatic local Tesseract discovery with reusable session support.

## Inheritance

- object
- TesseractOcr

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Charts, Barcodes, OCR and Provenance](/docs/foundations/) Guide
  
  Add ChartForgeX charts, Mermaid diagrams and CodeGlyphX barcodes to documents, recognize text with OCR engines, and verify C2PA Content Credentials.

Filter members 

Show inherited

## Methods

`public static async Task<TesseractOcrSession> CreateSessionAsync(TesseractOcrSessionOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-createsessionasync-officeimo-ocr-tesseract-tesseractocrsessionoptions-threading-cancellationtoken)

Discovers Tesseract, validates it, and provisions missing curated language data when enabled.

Parameters

**options OfficeIMO.Ocr.Tesseract.TesseractOcrSessionOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<TesseractOcrSession>`

`public static async Task<OcrResult> RecognizeFileAsync(string imagePath, TesseractOcrSessionOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-recognizefileasync-string-officeimo-ocr-tesseract-tesseractocrsessionoptions-threading-cancellationtoken)

Recognizes a supported image file with automatic runtime discovery.

Parameters

**imagePath string required**

**options OfficeIMO.Ocr.Tesseract.TesseractOcrSessionOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<OcrResult>`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:84543D3B63BA4C5E9E026BC6B41FE31A6AA521BC22C311B4980142765770BE9A -->
