L_Doc2GetSupportedEngineFormats

#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.

Parameters

L_HDOC2 hDoc

Handle to the OCR document. This handle is obtained by calling the L_Doc2StartUp function.

DOC2_FORMATTYPE ppFormats

Pointer to a DOC2_FORMATTYPE array to be updated with the list of the supported engine document formats.

L_INT * pnFormatsCount

Pointer to an integer to be updated with the number of the supported engine document formats in ppFormats.

Returns

Value Meaning
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

See Also

Functions

Topics

Example

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; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - OmniPage Engine C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.