L_DocSetSpecialChar

#include "ltdoc.h"

L_LTDOC_API L_INT L_DocSetSpecialChar(hDoc, pSpecialChar)

L_HDOC hDoc;

/* handle to the OCR document */

pSPECIALCHAR pSpecialChar;

/* pointer to a SPECIALCHAR structure */

Sets the special characters.

Parameter

Description

hDoc

Handle to the OCR document.

pSpecialChar

Pointer to a SPECIALCHAR structure which contains the characters to be set.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Sets the special characters to be used in the next recognition process and save results process.

To get the current special characters, call L_DocGetSpecialChar.

To recognize one or more pages, call L_DocRecognize.

Call this function after the recognition process has completed. When L_DocSetSpecialChar is called with the specified characters, the engine will replace all missing or rejected characters with these newly set special characters. This helps the user find the missing or rejected characters with minimal effort when the recognition results are saved to a file.

Required DLLs and Libraries

LTDOC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_DocGetStatus, L_DocRecognize, L_DocSaveResultsToMemory, L_DocFreeMemoryResults, L_DocSetRecognitionResultOptions, L_DocGetRecognitionResultOptions, L_DocEnumOutputFileFormats, L_DocGetTextFormatInfo, L_DocSaveResultsToFile, L_DocGetSpecialChar, L_DocGetRecognizedCharacters, L_DocSetRecognizedCharacters, L_DocFreeRecognizedCharacters

Topics:

OCR Functions: Recognition

 

Recognizing Document Pages

Example

 L_INT DocSetSpecialCharExample(L_HDOC hDoc,L_INT nPageIndex)
{
   L_INT nRet;
   RECOGNIZEOPTS RecogOpts;
   RecogOpts.uStructSize = sizeof(RECOGNIZEOPTS);
   RecogOpts.nPageIndexStart = nPageIndex;
   RecogOpts.nPagesCount = 1;
   RecogOpts.SpellLangId = LANG_ID_ENGLISH;
   RecogOpts.pszFileName = TEXT("C:\\Program Files\\LEAD Technologies\\LEADTOOLS 15\\Images\\testrdf.rdf");

   nRet = L_DocRecognize (hDoc, &RecogOpts, NULL, NULL);
   if (nRet == SUCCESS)
   {
      SPECIALCHAR SpecialChar;

      ZeroMemory(&SpecialChar, sizeof(SPECIALCHAR));
      nRet = L_DocGetSpecialChar(hDoc, &SpecialChar, sizeof(SPECIALCHAR));
      if(nRet != SUCCESS)
         return nRet;

      if (SpecialChar.chMissSym != L'^')
         SpecialChar.chMissSym = L'^';

      nRet = L_DocSetSpecialChar(hDoc, &SpecialChar);
      if(nRet != SUCCESS)
         return nRet;
   }
   else
      return nRet;

   //...
   //... save recognition results using L_DocSaveResultsToFile
   //...
   return SUCCESS;
}