On this page
Guides
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.
Sample
Full code sample which shows how to use the ComPDFKit OCR module on scanned documents in multiple languages.
c#
string inputFilePath = "***";
string outputFolderPath = "***";
string outputFileName = "***";
CPDFConverterSearchablePDF converter = CPDFConvertFactroy.CreateConverter(CPDFConvertType.CPDFConvertTypePDFSearchable, inputFilePath) as CPDFConverterSearchablePDF;
CPDFConvertPDFSearchableOptions searchableOptions = new CPDFConvertPDFSearchableOptions();
searchableOptions.OCRLanguage = ComDocumentAIOCR.Language.ENGLISH;
int pageCount = converter.GetPagesCount();
int[] pageArray = new int[pageCount];
for (int i = 0; i < pageArray.Length; i++)
{
pageArray[i] = i + 1;
}
ConvertError error = ConvertError.ERR_UNKNOWN;
converter.Convert(outputFolderPath, ref outputFileName, searchableOptions, pageArray, ref error, getPorgress);