Table of Contents

Method RunAsync

Namespace
LMKit.Integrations.Tesseract
Assembly
LM-Kit.NET.dll

RunAsync(OcrParameters, CancellationToken)

Runs OCR on the provided image data asynchronously.

public override Task<OcrResult> RunAsync(OcrParameters ocrParameters, CancellationToken cancellationToken = default)

Parameters

ocrParameters OcrParameters

An OcrParameters instance containing the image buffer, attachment metadata, and configuration options.

cancellationToken CancellationToken

A CancellationToken to observe for cancellation requests.

Returns

Task<OcrResult>

A Task<TResult> that produces an OcrResult containing recognized text elements, their bounding boxes, and page geometry information.

Exceptions

ArgumentNullException

Thrown if EnableLanguageDetection is true but VisionModel is null.

FileNotFoundException

Thrown if the required Tesseract traineddata file is not found and EnableModelDownload is false.

OperationCanceledException

Thrown if the operation is canceled via the cancellationToken.