L_DocSelectLanguages

#include "ltdoc.h"

L_LTDOC_API L_INT L_DocSelectLanguages(hDoc, pLangIds, nLangCount)

L_HDOC hDoc;

/* handle to the OCR document */

LANGIDS * pLangIds;

/* pointer to languages to be activated */

L_INT nLangCount;

/* language count */

Activates the specified languages into the OCR document engine.

Parameter

Description

hDoc

Handle to the OCR document.

pLangIds

Array of language ids that will be activated.

nLangCount

Number of language array elements in pLangIds

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Defines the main part of the Language environment of the Character Set.

If this function is not called to specify the language(s) to be recognized, the default value, the English language, is applied.

To get the current activated languages, call L_DocGetSelectedLanguages.

To get the character options for the current activated languages, call L_DocGetCharLangsOptions function.

To recognize page or set of pages, call L_DocRecognize.

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_DocGetSelectedLanguages, L_DocFreeLanguages, L_DocSetCharLangsOptions, L_DocGetCharLangsOptions, L_DocIsCharEnabled, L_DocGetDefaultSpellLanguages

Topics:

OCR Functions: Languages

 

Working with Languages

Example

 L_INT DocSelectLanguagesExample(L_HDOC hDoc)
{
   L_INT nRet;
   CHAROPTIONS CharOpts;
   LANGIDS SelLangs[1];

   SelLangs[0] = LANG_ID_ENGLISH;

   nRet = L_DocSelectLanguages(hDoc, SelLangs, 1);
   if (nRet != SUCCESS)
   {
      MessageBox(NULL, TEXT("Couldn't set English as the default language."), TEXT("Error!"), MB_OK);
      return nRet;
   }

   ZeroMemory(&CharOpts, sizeof(CHAROPTIONS));
   nRet = L_DocGetCharLangsOptions(hDoc, &CharOpts, sizeof(CHAROPTIONS));
   if(nRet != SUCCESS)
      return nRet;

   if (CharOpts.CharFilter != ZONE_CHAR_FILTER_ALL)
      CharOpts.CharFilter = ZONE_CHAR_FILTER_ALL;

   nRet = L_DocSetCharLangsOptions (hDoc, &CharOpts);
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}