Table of Contents

Class OcrStartingEventArgs

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

EventArgs for when OCR is about to start. Carries the OCR parameters and allows cancellation.

public class OcrStartingEventArgs : EventArgs
Inheritance
OcrStartingEventArgs
Inherited Members

Examples

ocrEngine.OcrStarting += (sender, e) =>
{
    Console.WriteLine($"OCR starting on page {e.PageIndex}");
    Console.WriteLine($"Image: {e.Parameters.Image.Width}x{e.Parameters.Image.Height}");

    // Cancel OCR for specific pages
    if (e.PageIndex > 10)
        e.Cancel = true;
};

Properties

Cancel

If set to true by any event subscriber, OCR will be canceled.

PageIndex

The zero-based index of the page being processed.

Parameters

The parameters that will be passed into OCR (image buffer, attachment, etc.).

Share