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
ocrParametersOcrParametersAn OcrParameters instance containing the image buffer, attachment metadata, and configuration options.
cancellationTokenCancellationTokenA 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
truebut VisionModel isnull.- 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.