L_DocSetSpecialChar

#include "ltdoc.h"

L_INT EXT_FUNCTION 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 a page(s), 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

void TestSpecialChar(L_HDOC hDoc, L_INT nPageIndex)
{
   RECOGNIZEOPTS RecogOpts;
   RecogOpts.uStructSize = sizeof(RECOGNIZEOPTS);
   RecogOpts.nPageIndexStart = nPageIndex;
   RecogOpts.nPagesCount = 1;
   RecogOpts.SpellLangId = LANG_ID_ENGLISH;
   RecogOpts.pszFileName = TEXT("c:\\testrdf.rdf");

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

      memset(&SpecialChar, 0, sizeof(SPECIALCHAR));
      L_DocGetSpecialChar(hDoc, &SpecialChar, sizeof(SPECIALCHAR));

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

      L_DocSetSpecialChar(hDoc, &SpecialChar);
   }

   //...
   //... save recognition results using L_DocSaveResultsToFile
   //...
}