# TesseractOcrSession

Reusable, fully resolved Tesseract OCR session for raster images from any document format.

Class 

`OfficeIMO.Ocr.Tesseract`

**Namespace**

`OfficeIMO.Ocr.Tesseract`

**Assembly**

`OfficeIMO.Ocr.Tesseract`

**Source revision**

`063fe3ee9839` with working tree changes

**Source**

[TesseractOcrSession.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr.Tesseract/TesseractOcrSession.cs#L31)

**Modifiers**

sealed

Reusable, fully resolved Tesseract OCR session for raster images from any document format.

## Inheritance

- object
- TesseractOcrSession

## 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.

## Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Method [TesseractOcr.CreateSessionAsync](/api/ocr-tesseract/officeimo-ocr-tesseract-tesseractocr/#method-createsessionasync-officeimo-ocr-tesseract-tesseractocrsessionoptions-threading-cancellationtoken)

Filter members 

Show inherited

## Methods

`public Task<OcrResult> RecognizeAsync(byte[] image, string mediaType, string? sourceName = null, CancellationToken cancellationToken = default)` [#](#method-recognizeasync-byte-string-string-threading-cancellationtoken)

[TesseractOcrSession.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr.Tesseract/TesseractOcrSession.cs#L31)

Recognizes one supported raster payload.

Parameters

**image byte[] required**

**mediaType string required**

**sourceName string? = 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?`

## Properties

`public TesseractOcrRuntimeEvidence Runtime { get; }` [#](#property-runtime)

[TesseractOcrSession.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr.Tesseract/TesseractOcrSession.cs#L20)

Resolved runtime and trained-data evidence.

`public IOcrEngine Engine { get; }` [#](#property-engine)

[TesseractOcrSession.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr.Tesseract/TesseractOcrSession.cs#L23)

The reusable engine-neutral OCR engine.

<!-- PowerForge markdown artifact sha256:DC62579E7E7C41096B7B3FEA670115FFDEE6FEC27F41F40655CAE34EDC9C50A9 -->
