Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
COM Interoperability: Recognizing Pages (Deprecated)

The information on this topic is deprecated as of LEADTOOLS v16.5.

Take the following steps to start a project and to add some code that demonstrates how to draw pages and zones:
  1. Start with the program you created in COM Interoperability Working With Pages
  2. Drag and drop two command buttons in Form1. Leave all the buttons names as the default "Command6, Command7 ...", then change the following properties of Command6:
    PropertyValue
    Caption Recognize
  3. Change the following properties of Command7:
    PropertyValue
    CaptionGets Status
  4. Add the following code for the Command6 control’s click procedure:
    
    Private Sub Command6_Click()
       ' Set the english as the language for the checking subsystem that will be used for spell checking
       documentEngine.SpellLanguageId = RasterDocumentLanguage_English
       documentEngine.EnableSubsystem = True
       documentEngine.EnableCorrection = True
    
       ' Specifies the name of the file that will be used in the recognition.
       documentEngine.RecognitionDataFileName = "c:\testrdf.rdf"
    
       ' Recognize the first page of the RasterDocument object.
       documentEngine.Recognize 0, 1
       MsgBox "The engine finished recognizing the specified pages successfully"
    End Sub
    
  5. Add the following code for the Command7 control’s click procedure:
    
    Private Sub Command7_Click()
       ' Print some information about the recognition status
       Dim status As RasterDocumentRecognitionStatistic
       Set status = documentEngine.RecognitionStatistic
       Dim msg As String
    
       msg = "Recognition Time = " + CStr(status.RecognizedTime) + Chr(13) + _
             "Total Recognized Characters = " + CStr(status.RecognizedCharacterCount) + Chr(13) + _
             "Total Recognized Words = " + CStr(status.RecognizedWordCount) + Chr(13) + _
             "Total Rejected Characters = " + CStr(status.RejectCharacterCount) + Chr(13) + _
             "Total Rejected Words = " + CStr(status.RejectWordCount)
       MsgBox msg
    End Sub
    
  6. Build and Run the project to test it.
  7. Save this project to be used for testing other code samples.