Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS OCR C DLL Help

L_Doc2SetSpecialChar

Show in webframe

#include "ltdoc2.h"

L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2SetSpecialChar(hDoc, pSpecialChar)

L_HDOC2 hDoc;

/* handle to the OCR document */

pSPECIALCHAR2 pSpecialChar;

/* pointer to a SPECIALCHAR2 structure */

Sets the special characters.

Parameter

Description

hDoc

Handle to the OCR document.

pSpecialChar

Pointer to a SPECIALCHAR2 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 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 function.

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

Call this function after the recognition process has completed. When the L_Doc2SetSpecialChar function 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

LTDOC2

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_Doc2GetStatus, L_Doc2Recognize, L_Doc2SetRecognitionResultOptions, L_Doc2GetRecognitionResultOptions, L_Doc2EnumOutputFileFormats, L_Doc2GetTextFormatInfo, L_Doc2SaveResultsToFile, L_Doc2GetSpecialChar, L_Doc2GetRecognizedCharacters, L_Doc2SetRecognizedCharacters, L_Doc2FreeRecognizedCharacters

Topics:

OCR Functions: Recognition

 

Recognizing Document Pages

Example

L_LTDOC2TEX_API  L_INT Doc2SetSpecialCharExample(L_HDOC2 hDoc,L_INT nPageIndex)
{
   L_INT nRet;
   RECOGNIZEOPTS2 RecogOpts;
   RecogOpts.uStructSize = sizeof(RECOGNIZEOPTS2);
   RecogOpts.nPageIndexStart = nPageIndex;
   RecogOpts.nPagesCount = 1;
   RecogOpts.SpellLangId = DOC2_LANG_ID_ENGLISH;

   nRet = L_Doc2Recognize (hDoc, &RecogOpts, NULL, NULL);
   if (nRet == SUCCESS)
   {
      SPECIALCHAR2 SpecialChar;

      ZeroMemory(&SpecialChar, sizeof(SPECIALCHAR2));
      nRet = L_Doc2GetSpecialChar(hDoc, &SpecialChar, sizeof(SPECIALCHAR2));
      if(nRet != SUCCESS)
         return nRet;

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

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

   //...
   //... save recognition results using L_Doc2SaveResultsToFile
   //...
   return SUCCESS;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.