Table of Contents

Class PdfSearchableMakerOptions

Namespace
LMKit.Document.Pdf
Assembly
LM-Kit.NET.dll

Configures the behavior of PdfSearchableMaker operations, including text detection strategy, page range, parallelism, progress reporting, and save options.

public sealed class PdfSearchableMakerOptions
Inheritance
PdfSearchableMakerOptions
Inherited Members

Examples

using LMKit.Document.Pdf;

var options = new PdfSearchableMakerOptions
{
    TextPageHandling = PdfSearchableMaker.TextPageHandling.ForceOcr,
    TextDetectionStrategy = PdfSearchableMaker.TextDetectionStrategy.HasText,
    PageRange = "1-10",
    MaxDegreeOfParallelism = 4,
    SaveOptions = PdfSaveOptions.Incremental,
    Progress = new Progress<OcrProgressEventArgs>(e =>
        Console.WriteLine($"Page {e.PageIndex + 1}/{e.TotalPages}"))
};

await PdfSearchableMaker.ConvertToFileAsync(
    "scanned.pdf", ocr, "searchable.pdf", options);

Properties

Default

Default options used when no explicit options are provided.

EnableOrientationDetection

Gets or sets an optional override for automatic page orientation detection. When null, the engine uses its instance-level setting.

Languages

Gets or sets an optional list of Language values specifying which languages the OCR engine should recognize. When null, the engine uses its configured default.

MaxDegreeOfParallelism

Maximum number of pages to OCR concurrently. Default: 1 (sequential). Set higher to leverage multi-core CPUs or GPU-based OCR engines.

PageRange

An optional 1-based page range string (e.g., "1-5, 7, 9-12") specifying which pages to consider for OCR. Pages outside this range are left untouched. When null, empty, or "*", all pages are considered.

Progress

An optional per-call progress reporter. When set, this callback receives a OcrProgressEventArgs after each page is processed. Set Cancel to true inside the callback to abort remaining pages.

SaveOptions

Options controlling how the modified PDF is written. Default: None (full rewrite).

TextDetectionStrategy

Algorithm used to detect whether a page already has text. Only meaningful when TextPageHandling is Skip. Default: TextOnly.

TextPageHandling

Controls whether pages with existing text are skipped or re-OCRed. Default: Skip.

Share