Table of Contents

Method Convert

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

Convert(Attachment, OcrEngine, PdfSearchableMakerOptions, CancellationToken)

Makes a PDF attachment searchable synchronously by adding invisible text overlays.

public static Attachment Convert(Attachment source, OcrEngine ocrEngine, PdfSearchableMakerOptions options = null, CancellationToken cancellationToken = default)

Parameters

source Attachment

The source PDF attachment.

ocrEngine OcrEngine

The OCR engine to use for text recognition.

options PdfSearchableMakerOptions

Optional configuration. When null, Default is used.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Attachment

A new Attachment containing the searchable PDF.

Exceptions

ArgumentNullException

source or ocrEngine is null.

Convert(string, OcrEngine, PdfSearchableMakerOptions, CancellationToken)

Makes a PDF file searchable synchronously and returns the result as an attachment.

public static Attachment Convert(string inputPath, OcrEngine ocrEngine, 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.

options PdfSearchableMakerOptions

Optional configuration. When null, Default is used.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Attachment

A new Attachment containing the searchable PDF.

Exceptions

ArgumentNullException

inputPath or ocrEngine is null.

FileNotFoundException

The file specified by inputPath does not exist.

Share