Method ConvertToFileAsync
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
sourceAttachmentThe source PDF attachment.
ocrEngineOcrEngineThe OCR engine to use for text recognition.
outputPathstringPath where the searchable PDF will be written.
optionsPdfSearchableMakerOptionsOptional configuration. When
null, Default is used.cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task
A task representing the asynchronous operation.
Exceptions
- ArgumentNullException
source,ocrEngine, oroutputPathisnull.
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
inputPathstringPath to the source PDF file.
ocrEngineOcrEngineThe OCR engine to use for text recognition.
outputPathstringPath where the searchable PDF will be written.
optionsPdfSearchableMakerOptionsOptional configuration. When
null, Default is used.cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task
A task representing the asynchronous operation.
Exceptions
- ArgumentNullException
inputPath,ocrEngine, oroutputPathisnull.- FileNotFoundException
The file specified by
inputPathdoes not exist.