#include "ltdoc2.h"

L_LTDOC2_API L_INT L_Doc2SetSpecialCharExt(hDoc, nDocId, pSpecialChar)

Sets the special characters.


L_HDOC2 hDoc

Handle to the OCR document.

L_INT nDocId

Document ID created by calling L_Doc2CreateDocument.

pSPECIALCHAR2 pSpecialChar

Pointer to a SPECIALCHAR2 structure containing the characters to be set.


Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.


Sets the special characters that will replace missing or rejected characters the next time the recognition process is run and results are saved.

To get the current special characters, call the L_Doc2GetSpecialChar / L_Doc2GetSpecialCharExt function.

To recognize one or more pages, call the L_Doc2Recognize / L_Doc2RecognizeExt function.

Call L_Doc2SetSpecialCharExt after the recognition process has completed. When L_Doc2SetSpecialChar / L_Doc2SetSpecialCharExt is called with the specified characters, the engine replaces all missing or rejected characters with these newly set special characters. This helps find the missing or rejected characters with minimal effort when the recognition results are saved to a file.

Required DLLs and Libraries

See Also




L_INT Doc2SetSpecialCharExampleExt(L_HDOC2 hDoc, L_INT nDocId, L_INT nPageIndex) 
   L_INT nRet; 
   RecogOpts.uStructSize = sizeof(RECOGNIZEOPTS2); 
   RecogOpts.nPageIndexStart = nPageIndex; 
   RecogOpts.nPagesCount = 1; 
   RecogOpts.SpellLangId = DOC2_LANG_ID_ENGLISH; 
   nRet = L_Doc2RecognizeExt (hDoc, nDocId, &RecogOpts, NULL, NULL); 
   if (nRet == SUCCESS) 
      SPECIALCHAR2 SpecialChar; 
      ZeroMemory(&SpecialChar, sizeof(SPECIALCHAR2)); 
      nRet = L_Doc2GetSpecialCharExt(hDoc, nDocId, &SpecialChar, sizeof(SPECIALCHAR2)); 
      if(nRet != SUCCESS) 
         return nRet; 
      if (SpecialChar.chMissSym != L'^') 
         SpecialChar.chMissSym = L'^'; 
      nRet = L_Doc2SetSpecialCharExt(hDoc, nDocId, &SpecialChar); 
      if(nRet != SUCCESS) 
         return nRet; 
      return nRet; 
   //... save recognition results using L_Doc2SaveResultsToFileExt 
   return SUCCESS; 
Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - OmniPage Engine C API Help