Method ConvertAsync
ConvertAsync(Attachment, OcrEngine, PdfSearchableMakerOptions, CancellationToken)
Makes a PDF attachment searchable asynchronously by adding invisible text overlays. The output contains the same number of pages as the input.
public static Task<Attachment> ConvertAsync(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 controlling text detection, page range, parallelism, progress reporting, and save behavior. When
null, Default is used.cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task<Attachment>
A new Attachment containing the searchable PDF.
Exceptions
- ArgumentNullException
sourceorocrEngineisnull.
ConvertAsync(string, OcrEngine, PdfSearchableMakerOptions, CancellationToken)
Makes a PDF file searchable asynchronously and returns the result as an attachment.
public static Task<Attachment> ConvertAsync(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
- Task<Attachment>
A new Attachment containing the searchable PDF.
Exceptions
- ArgumentNullException
inputPathorocrEngineisnull.- FileNotFoundException
The file specified by
inputPathdoes not exist.