Table of Contents

Method ConvertToFileAsync

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

ConvertToFileAsync(Attachment, OcrEngine, string, PdfSearchableMakerOptions, CancellationToken)

Makes a PDF attachment searchable and writes the result to a file asynchronously.

public static Task ConvertToFileAsync(Attachment source, OcrEngine ocrEngine, string outputPath, PdfSearchableMakerOptions options = null, CancellationToken cancellationToken = default)

Parameters

source Attachment

The source PDF attachment.

ocrEngine OcrEngine

The OCR engine to use for text recognition.

outputPath string

Path where the searchable PDF will be written.

options PdfSearchableMakerOptions

Optional configuration. When null, Default is used.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task

A task representing the asynchronous operation.

Exceptions

ArgumentNullException

source, ocrEngine, or outputPath is null.

ConvertToFileAsync(string, OcrEngine, string, PdfSearchableMakerOptions, CancellationToken)

Makes a PDF file searchable and writes the result to a new file asynchronously.

public static Task ConvertToFileAsync(string inputPath, OcrEngine ocrEngine, string outputPath, PdfSearchableMakerOptions options = null, CancellationToken cancellationToken = default)

Parameters

inputPath string

Path to the source PDF file.

ocrEngine OcrEngine

The OCR engine to use for text recognition.

outputPath string

Path where the searchable PDF will be written.

options PdfSearchableMakerOptions

Optional configuration. When null, Default is used.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task

A task representing the asynchronous operation.

Exceptions

ArgumentNullException

inputPath, ocrEngine, or outputPath is null.

FileNotFoundException

The file specified by inputPath does not exist.

Share