Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
L_Doc2GetSupportedEngineFormats
#include "ltdoc2.h"
L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2GetSupportedEngineFormats(hDoc, ppFormats, pnFormatsCount)
L_HDOC2 hDoc; |
/* handle to the OCR document */ |
DOC2_FORMATTYPE ** ppFormats; |
/* output supported engine document formats list */ |
L_INT * pnFormatsCount; |
/* number of the supported engine document formats */ |
Gets a list of all supported native engine document formats that you can save your recognition results to.
Parameter |
Description |
hDoc |
Handle to the OCR document. This handle is obtained by calling the L_Doc2StartUp function. |
ppFormats |
Pointer to a DOC2_FORMATTYPE array to be updated with the list of the supported engine document formats. |
pnFormatsCount |
Pointer to an integer to be updated with the number of the supported engine document formats in ppFormats. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
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
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_Doc2GetEngineFormatFriendlyName, L_Doc2FreeEngineFormats, L_Doc2SaveResultsToFile, L_Doc2SetOutputFormatSettings |
Topics: |
Example
L_LTDOC2TEX_API L_INT Doc2GetSupportedEngineFormatsExample(L_HDOC2 hDoc) { DOC2_FORMATTYPE * pFormats = NULL; L_INT nFormatsCount = 0; L_INT nRet = L_Doc2GetSupportedEngineFormats(m_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(m_hDoc, pFormats[i], NULL, &nLength); if(nRet == SUCCESS) { pszFormatName = (L_TCHAR*)GlobalAllocPtr(GHND, nLength * sizeof(L_TCHAR)); if(pszLangName) { L_Doc2GetEngineFormatFriendlyName(m_hDoc, pFormats[i], pszFormatName, &nLength); MessageBox(pszFormatName, TEXT("Supported Native Engine Formats"), MB_OK); } } } L_Doc2FreeEngineFormats(m_hDoc, &pFormats); } return nRet; }