Table of Contents

Class OcrEngine

Namespace
LMKit.Extraction.Ocr
Assembly
LM-Kit.NET.dll

Represents an Optical Character Recognition (OCR) engine capable of processing image data and extracting text. Concrete implementations must override RunAsync(OcrParameters, CancellationToken) to perform actual OCR. Exposes events that fire just before and just after OCR executes, and allows cancellation.

public abstract class OcrEngine
Inheritance
OcrEngine
Derived
Inherited Members

Methods

OnOcrCompleted(OcrCompletedEventArgs)

Raises the OcrCompleted event (if any subscribers exist).

OnOcrStarting(OcrStartingEventArgs)

Raises the OcrStarting event (if any subscribers exist).

RunAsync(OcrParameters, CancellationToken)

Executes the OCR process using the provided parameters. Concrete subclasses must override this method to implement specific OCR logic (e.g., calling a third‐party OCR library).

Events

OcrCompleted

Raised after OCR finishes (whether it succeeded, was canceled, or faulted). Subscribers can inspect the parameters, result, and/or any exception that occurred.

OcrStarting

Raised just before OCR begins. Subscribers can inspect the attachment and, if they wish, set Cancel = true to abort.