# DelegateOcrEngine

Adapts a caller-owned callback, including cloud SDK integrations, to IOcrEngine.

Class 

`OfficeIMO.Ocr`

**Namespace**

`OfficeIMO.Ocr`

**Assembly**

`OfficeIMO.Ocr`

**Source revision**

`063fe3ee9839` with working tree changes

**Source**

[IOcrEngine.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr/IOcrEngine.cs#L25)

**Implements**

`IOcrEngine`

**Modifiers**

sealed

Adapts a caller-owned callback, including cloud SDK integrations, to [IOcrEngine](/api/ocr/officeimo-ocr-iocrengine/).

## Inheritance

- object
- DelegateOcrEngine

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

## Constructors

`public DelegateOcrEngine(string id, Func<OcrRequest, CancellationToken, Task<OcrResult>> recognizeAsync, OcrEngineCapabilities? capabilities = null)` [#](#constructor-ctor-string-func-officeimo-ocr-ocrrequest-system-threading-cancellationtoken-system-threading-tasks-task-officeimo-ocr-ocrresult-officeimo-ocr-ocrenginecapabilities)

[IOcrEngine.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr/IOcrEngine.cs#L25)

Creates a callback-backed OCR engine.

Parameters

**id string required**

**recognizeAsync System.Func<OfficeIMO.Ocr.OcrRequest, System.Threading.CancellationToken, System.Threading.Tasks.Task<OfficeIMO.Ocr.OcrResult>> required**

**capabilities OfficeIMO.Ocr.OcrEngineCapabilities? = null optional**

## Methods

`public Task<OcrResult> RecognizeAsync(OcrRequest request, CancellationToken cancellationToken = default)` [#](#method-recognizeasync-officeimo-ocr-ocrrequest-threading-cancellationtoken)

[IOcrEngine.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr/IOcrEngine.cs#L42)

Recognizes text and optional detailed spans from one raster payload.

Parameters

**request OfficeIMO.Ocr.OcrRequest 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?`

## Properties

`public string Id { get; }` [#](#property-id)

[IOcrEngine.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr/IOcrEngine.cs#L35)

Stable provider identifier used in diagnostics and provenance. The value must remain unchanged for the lifetime of this configured engine instance, and the untrimmed value must not exceed [OcrEngineRunner.MaximumEngineIdCharacters](/api/ocr/officeimo-ocr-ocrenginerunner/) characters.

`public OcrEngineCapabilities Capabilities { get; }` [#](#property-capabilities)

[IOcrEngine.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Ocr/IOcrEngine.cs#L38)

Stable capabilities exposed by this configured engine instance.

<!-- PowerForge markdown artifact sha256:6269C09E814C62CEAA4CB57F071B3AE0D9C837F5362BF6DC3E9CB6FCC9DC2DA2 -->
