Working with Recognition Results Using LEADTOOLS OCR Module - LEAD Engine

To add code to an existing project in order to work with recognition results:

  1. Start with the program you created in Recognize Pages Using LEADTOOLS OCR Module - LEAD Engine.
  2. Define the following global IDs in Ezfunc.h in the OCR_Ltocr directory:

    #define IDM_SAVE_RESULTS            207 

  3. Edit EZFUNC.RC file in the OCR_Ltocr directory and add the following lines:

    MAIN_MENU   MENU   
    BEGIN   
       ...    
       ...    
       MENUITEM "Save Results"          IDM_SAVE_RESULTS   
    END 

  4. In the MainWndProc procedure, add the following code to the switch statement for WM_COMMAND:

    case IDM_SAVE_RESULTS: 
    { 
       L_TCHAR szFileName[MAX_PATH] = {0}; 
       lstrcpy(szFileName, TEXT("C:\\Users\\Public\\Documents\\output.pdf")); 
       nRet = L_OcrDocument_Save(hDocument, szFileName, DOCUMENTFORMAT_PDF, MyCallback, NULL); 
       if (nRet != SUCCESS) 
       { 
          wsprintf (achBuff, TEXT("Error %d in saving recognition results to a file"), nRet); 
          MessageBox (NULL, achBuff, TEXT("Error"), MB_OK); 
       } 
       else 
       { 
          wsprintf (achBuff, TEXT("Successfully saved recognition results to %s"), szFileName); 
          MessageBox (NULL, achBuff, TEXT("Notice"), MB_OK); 
       } 
    } 
    break; 

  5. Build SimpleLoad.exe.

  6. Run SimpleLoad.exe.
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - LEAD Engine C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.