Method ConvertToFile
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
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.
Exceptions
- ArgumentNullException
source,ocrEngine, oroutputPathisnull.
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
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.
Exceptions
- ArgumentNullException
inputPath,ocrEngine, oroutputPathisnull.- FileNotFoundException
The file specified by
inputPathdoes not exist.