Image Viewer CP ActiveX Control

OCRTextFile2SearchablePDF

 

According Searchable Multipage PDF Text File and Convert current loaded image to searchable PDF/A file. You may add , delete or change the record of Searchable Text file before call OCRTextFile2SearchablePDF.

The Searchable Text file format is record each OCR Recognized Character:
Left,Top,Right, Bottom, Character
e.g.
40,0,43,9,i

Public Function OCRTextFile2SearchablePDF( _
   ByVal strTextFile  As String, _
   ByVal strPDFFile As String)
 As Integer

 

Parameter

strTextFile
The input searchable PDF Text file. If you input output.txt. It will auto searching same folder whether have output0001.txt, output0002.txt... and add these text file to specific page if you load multipage document.

strPDFFile
The output searchable PDF/A file.

Return Value

Return 1 - Successful
Return -1 - Successful, but some page cannot matched searchable PDF Text file .
Return -2 - General Error.
Return -3 - The searchable PDF Text file name is empty.
Return -4 - The output searchable PDF/A file name is empty.




Example

   

Visual Basic Syntax
ImageViewer1.LoadMultiPage "c:\source.tif",0
iresult = ImageViewer1.OCR2SearchableTextFile("c:\temp\output.txt", iLangIndex, "dictfiles")
iresult = ImageViewer1.OCRTextFile2SearchablePDF("c:\temp\output.txt", "c:\temp\outputpdf.pdf")