Table of Contents

Method ConvertFilesAsync

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

ConvertFilesAsync(IEnumerable<string>, OcrEngine, string, PdfSearchableMakerOptions, CancellationToken)

Makes multiple PDF files searchable in sequence, writing each result to the specified output directory. Output files retain the original file names.

public static Task ConvertFilesAsync(IEnumerable<string> inputPaths, OcrEngine ocrEngine, string outputDirectory, PdfSearchableMakerOptions options = null, CancellationToken cancellationToken = default)

Parameters

inputPaths IEnumerable<string>

Paths to the source PDF files.

ocrEngine OcrEngine

The OCR engine to use for text recognition.

outputDirectory string

Directory where searchable PDFs will be written.

options PdfSearchableMakerOptions

Optional configuration applied to every file. When null, Default is used.

cancellationToken CancellationToken

Token to cancel the entire batch.

Returns

Task

A task representing the asynchronous operation.

Examples

var files = new[] { "scan1.pdf", "scan2.pdf", "scan3.pdf" };
var ocr = new LMKitOcr();

await PdfSearchableMaker.ConvertFilesAsync(
    files, ocr, @"C:\output\searchable");

Exceptions

ArgumentNullException

inputPaths, ocrEngine, or outputDirectory is null.

Share