#include "ltdoc2.h"
L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2GetSupportedLanguages(hDoc, ppLangIds, pnLangCount)
Gets a list of all the supported OCR languages according to the installed language files, inside the engine directory.
Handle to the OCR document.
Pointer to a DOC2_LANGIDS array to be updated with the currently supported languages.
Pointer to an integer to be updated with the number of the supported languages in ppLangIds.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To activate the recognized languages, call the L_Doc2SelectLanguages function.
This function will allocate memory for ppLangIds. To free the ppLangIds parameter, call the L_Doc2FreeLanguages function.
To get the character options for the current activated languages, call the L_Doc2GetCharLangsOptions function.
To set the character options for the current activated languages, call the L_Doc2SetCharLangsOptions function.
Required DLLs and Libraries
L_INT Doc2GetSupportedLanguagesExample(L_HDOC2 hDoc)
{
L_INT nRet;
DOC2_LANGIDS * pLangIds = NULL;
L_INT nLangCount = 0;
L_TCHAR * pszLangName = NULL;
L_INT nLength = 0;
nRet = L_Doc2GetSupportedLanguages(hDoc, &pLangIds, &nLangCount);
if (nRet != SUCCESS)
return nRet;
for (L_INT i=0; i<nLangCount; i++)
{
nRet = L_Doc2GetLanguageFriendlyName(hDoc, pLangIds[i], NULL, &nLength);
if(nRet == SUCCESS)
{
pszLangName = (L_TCHAR*)GlobalAllocPtr(GHND, nLength * sizeof(L_TCHAR));
if(pszLangName)
{
L_Doc2GetLanguageFriendlyName(hDoc, pLangIds[i], pszLangName, &nLength);
MessageBox(NULL, pszLangName, TEXT("Notice!"), MB_OK);
}
}
}
nRet = L_Doc2FreeLanguages (hDoc, &pLangIds);
return nRet;
}