# OcrEngineRunner

Coordinates bounded calls to a shared OCR engine instance.

Class 

`OfficeIMO.Ocr`

**Namespace**

`OfficeIMO.Ocr`

**Assembly**

`OfficeIMO.Ocr`

**Source revision**

`063fe3ee9839` with working tree changes

**Source**

[OcrEngineRunner.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr/OcrEngineRunner.cs#L16)

**Modifiers**

static

Coordinates bounded calls to a shared OCR engine instance.

## Inheritance

- object
- OcrEngineRunner

Filter members 

Show inherited

## Methods

`public static OcrEngineExecution CreateExecution(IOcrEngine engine)` [#](#method-createexecution-officeimo-ocr-iocrengine)

[OcrEngineRunner.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr/OcrEngineRunner.cs#L47)

Captures one validated identity and capability snapshot for a logical OCR operation.

Parameters

**engine OfficeIMO.Ocr.IOcrEngine required**

Returns

`OcrEngineExecution`

`public static string GetValidatedEngineId(IOcrEngine engine)` [#](#method-getvalidatedengineid-officeimo-ocr-iocrengine)

[OcrEngineRunner.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr/OcrEngineRunner.cs#L16)

Reads and validates the stable identifier exposed by an OCR engine.

Parameters

**engine OfficeIMO.Ocr.IOcrEngine required**

Returns

`string`

`public static Task<OcrResult> RecognizeAsync(IOcrEngine engine, OcrRequest request, TimeSpan timeout, CancellationToken cancellationToken = default)` [#](#method-recognizeasync-officeimo-ocr-iocrengine-officeimo-ocr-ocrrequest-timespan-threading-cancellationtoken)

[OcrEngineRunner.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr/OcrEngineRunner.cs#L66)

Runs one recognition request within a total timeout. Engines that do not advertise concurrent-request support are serialized across every Reader, PDF, and caller integration using this method.

Parameters

**engine OfficeIMO.Ocr.IOcrEngine required**

**request OfficeIMO.Ocr.OcrRequest required**

**timeout System.TimeSpan required**

**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?`

## Fields

`public const int MaximumEngineIdCharacters` [#](#field-maximumengineidcharacters)

[OcrEngineRunner.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr/OcrEngineRunner.cs#L9)

Maximum accepted length of an OCR engine identifier before surrounding whitespace is removed.

Value: `256`

<!-- PowerForge markdown artifact sha256:34D74B7076188DB7CAAD65C65425E1A29BC66533235BDCEEA7DFA8F79FDF2D40 -->
