L_Doc2SelectLanguagesExt

#include "ltdoc2.h"

L_LTDOC2_API L_INT L_Doc2SelectLanguagesExt(hDoc, nDocId, pLangIds, nLangCount)

Activates the specified languages in the OCR document engine.

Parameters

L_HDOC2 hDoc

Handle to the OCR document.

L_INT nDocId

Document ID created L_Doc2CreateDocument.

DOC2_LANGIDS * pLangIds

Array of language ids that will be activated.

L_INT nLangCount

Number of language array elements in pLangIds.

Returns

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

Comments

This function 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 currently supported languages, call the L_Doc2GetSupportedLanguages function.

To get the current activated languages, call the L_Doc2GetSelectedLanguages / L_Doc2GetSelectedLanguagesExt function.

To get the character options for the currently activated languages, call the L_Doc2GetCharLangsOptions / L_Doc2GetCharLangsOptionsExt function.

To recognize a page or a set of pages, call the L_Doc2Recognize / L_Doc2RecognizeExt function.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT Doc2SelectLanguagesExampleExt(L_HDOC2 hDoc, L_INT nDocId) 
{ 
   L_INT nRet; 
   CHAROPTIONS2 CharOpts; 
   DOC2_LANGIDS SelLangs[1]; 
 
   SelLangs[0] = DOC2_LANG_ID_ENGLISH; 
 
   nRet = L_Doc2SelectLanguagesExt(hDoc, nDocId, 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(CHAROPTIONS2)); 
   nRet = L_Doc2GetCharLangsOptionsExt(hDoc, nDocId, &CharOpts, sizeof(CHAROPTIONS2)); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   if (CharOpts.CharFilter != DOC2_ZONE_CHAR_FILTER_ALL) 
      CharOpts.CharFilter = DOC2_ZONE_CHAR_FILTER_ALL; 
 
   nRet = L_Doc2SetCharLangsOptionsExt (hDoc, nDocId, &CharOpts); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   if (CharOpts.pszCharFilterPlus) 
      GlobalFreePtr(CharOpts.pszCharFilterPlus); 
 
   if (CharOpts.pszCharPlus) 
      GlobalFreePtr(CharOpts.pszCharPlus); 
   return SUCCESS; 
} 
Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - OmniPage Engine C API Help