Skip to main content
Kofax

How can I force OCR to re-occur based on a value in the Document?

9950

QAID # 9950 Published 

Question / Problem:

How can I force OCR to re-occur based on a value in the Document?

Answer / Solution:

The following example will OCR a page when sState is "CA".

It will then search the new OCR results for the word "MyKeyword" and reclassify the document as "MyNewSubClass" if found:

          Private Sub Document_Afterclassifyxdoc(pXDoc As CASCADELib.CscXDocument)
Dim sState As String
Dim sText As String
Dim PageRecognizer As New MpsPageRecognizing
If sState = "CA" Then
   PageRecognizer.Recognize pXDoc, Project.RecogProfiles.
   ItemByName("RecoStar"), 0 ' Note the profile would need
                             '  to be changed from Recostar
                             '  to the name of the profile configured in project
   sText = UCase(pXDoc.Words.Text)
   If InStr(1, sText, "MyKeyword") > 0 Then
      pXDoc.Reclassify "MyNewSubClass"
   End If
 End If
End Sub

Note: MPSPageRecognizer needs to be registered as a reference in the menu of script editor: Reference LCI Memphis Forms 2.0

Applies to:

Product Version Category
AXPRO 3.1 Project Builder
  • Was this article helpful?