#include "ltdoc2.h"
L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2GetSupportedEngineFormats(hDoc, ppFormats, pnFormatsCount)
Gets a list of all supported native engine document formats that you can save your recognition results to.
Handle to the OCR document. This handle is obtained by calling the L_Doc2StartUp function.
Pointer to a DOC2_FORMATTYPE array to be updated with the list of the supported engine document formats.
Pointer to an integer to be updated with the number of the supported engine document formats in ppFormats.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
You need to declare a pointer to DOC2_FORMATTYPE enumeration; pass this pointer address to this function. The engine will allocate the amount of the required memory, and will return the number of the supported engine document formats through the pnFormatsCount parameter. You also need to call the L_Doc2FreeEngineFormats function to free the allocated ppFormats parameter memory.
Required DLLs and Libraries
L_INT Doc2GetSupportedEngineFormatsExample(L_HDOC2 hDoc)
{
DOC2_FORMATTYPE * pFormats = NULL;
L_INT nFormatsCount = 0;
L_INT nRet = L_Doc2GetSupportedEngineFormats(hDoc, &pFormats, &nFormatsCount);
if(nRet == SUCCESS)
{
for(L_INT i = 0; i < nFormatsCount; i++)
{
L_TCHAR * pszFormatName = NULL;
L_INT nLength = 0;
nRet = L_Doc2GetEngineFormatFriendlyName(hDoc, pFormats[i], NULL, &nLength);
if(nRet == SUCCESS)
{
pszFormatName = (L_TCHAR*)GlobalAllocPtr(GHND, nLength * sizeof(L_TCHAR));
if(pszFormatName)
{
L_Doc2GetEngineFormatFriendlyName(hDoc, pFormats[i], pszFormatName, &nLength);
MessageBox(NULL, pszFormatName, TEXT("Supported Native Engine Formats"), MB_OK);
}
}
}
L_Doc2FreeEngineFormats(hDoc, &pFormats);
}
return nRet;
}