Method Convert
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
sourceAttachmentThe source PDF attachment.
ocrEngineOcrEngineThe OCR engine to use for text recognition.
optionsPdfSearchableMakerOptionsOptional configuration. When
null, Default is used.cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Attachment
A new Attachment containing the searchable PDF.
Exceptions
- ArgumentNullException
sourceorocrEngineisnull.
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
inputPathstringPath to the source PDF file.
ocrEngineOcrEngineThe OCR engine to use for text recognition.
optionsPdfSearchableMakerOptionsOptional configuration. When
null, Default is used.cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Attachment
A new Attachment containing the searchable PDF.
Exceptions
- ArgumentNullException
inputPathorocrEngineisnull.- FileNotFoundException
The file specified by
inputPathdoes not exist.