# OfficeDocumentOcrExecutionExtensions

Runs optional OCR engines against bounded Reader candidates and merges recognized text.

Class 

`OfficeIMO.Reader`

**Namespace**

`OfficeIMO.Reader`

**Assembly**

`OfficeIMO.Reader.Ocr`

**Source revision**

`063fe3ee9839` with working tree changes

**Source**

[OfficeDocumentOcrExecution.Budget.cs:6](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Reader.Ocr/Execution/OfficeDocumentOcrExecution.Budget.cs#L6)

**Modifiers**

static

Runs optional OCR engines against bounded Reader candidates and merges recognized text.

## Inheritance

- object
- OfficeDocumentOcrExecutionExtensions

Filter members 

Show inherited

## Methods

`public static async Task<OfficeDocumentOcrExecutionResult> ApplyOcrAsync(OfficeDocumentReadResult document, IOcrEngine engine, OfficeDocumentOcrExecutionOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-applyocrasync-officeimo-reader-officedocumentreadresult-officeimo-ocr-iocrengine-officeimo-reader-officedocumentocrexecutionoptions-threading-cancellationtoken)

Executes an OCR engine over validated candidate assets, preserves deterministic result order, and enriches the document.

Parameters

**document OfficeIMO.Reader.OfficeDocumentReadResult required**

**engine OfficeIMO.Ocr.IOcrEngine required**

**options OfficeIMO.Reader.OfficeDocumentOcrExecutionOptions? = null optional**

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

Returns

`Task<OfficeDocumentOcrExecutionResult>`

`public static async Task<OfficeDocumentOcrExecutionResult> ApplyOcrTreeAsync(OfficeDocumentReadResult document, IOcrEngine engine, OfficeDocumentOcrExecutionOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-applyocrtreeasync-officeimo-reader-officedocumentreadresult-officeimo-ocr-iocrengine-officeimo-reader-officedocumentocrexecutionoptions-threading-cancellationtoken)

Executes OCR over a document and its nested results with one shared budget. Newly recognized nested text is projected into each parent for Markdown, chunk and AI consumers. Existing native content and rich nested results are preserved. Call after reading a container; Reader processors already visit individual documents and must not invoke this tree operation for every node.

Parameters

**document OfficeIMO.Reader.OfficeDocumentReadResult required**

**engine OfficeIMO.Ocr.IOcrEngine required**

**options OfficeIMO.Reader.OfficeDocumentOcrExecutionOptions? = null optional**

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

Returns

`Task<OfficeDocumentOcrExecutionResult>`

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