Convert PDF to Searchable PDF
Overview
To make a searchable PDF by adding invisible text to an image based PDF such as a scanned document using OCR.
Set Transparent Text Layer
When outputting a searchable PDF, you can use the following option to control the hidden text layer:
TransparentText: Whether to output a transparent text layer.
Sample
Full code sample which shows how to use the ComPDF OCR module on scanned documents in multiple languages.
c#
string inputFilePath = "***";
string password = "***";
string outputFileName = "***";
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.EnableOCR = true;
pdfOptions.Languages = new List<OCRLanguage> { OCRLanguage.e_ENGLISH };
ErrorCode error = CPDFConversion.StartPDFToSearchablePDF(inputFilePath, password, outputFileName, pdfOptions);