Table of Contents

Method ConvertToFile

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

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

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

public static void ConvertToFile(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.

Exceptions

ArgumentNullException

source, ocrEngine, or outputPath is null.

ConvertToFile(string, OcrEngine, string, PdfSearchableMakerOptions, CancellationToken)

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

public static void ConvertToFile(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.

Exceptions

ArgumentNullException

inputPath, ocrEngine, or outputPath is null.

FileNotFoundException

The file specified by inputPath does not exist.

Share