L_DocGetSupportedEngineFormats

#include "ltdoc.h"

L_LTDOC_API L_INT EXT_FUNCTION L_DocGetSupportedEngineFormats(hDoc, ppFormats, pnFormatsCount)

L_HDOC hDoc;

/* handle to the OCR document */

FORMAT_TYPE ** ppFormats;

/* output supported engine document formats list */

L_INT * pnFormatsCount;

/* number of the supported document engine 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_DocStartUp function.

ppFormats

Pointer to a FORMAT_TYPE 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 FORMAT_TYPE enumeration and 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_DocFreeEngineFormats function to free the allocated ppFormats parameter memory.

Required DLLs and Libraries

LTDOC

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_DocGetEngineFormatFriendlyName, L_DocFreeEngineFormats, L_DocSaveResultsToFile, L_Doc2SetOutputFormatSettings

Topics:

Recognizing Document Pages, LEAD OMR Overview

Example

 L_INT DocGetSupportedEngineFormatsExample(L_HDOC hDoc)

{
  FORMAT_TYPE * pFormats = NULL;

  L_INT nFormatsCount = 0;
  L_INT nRet = L_DocGetSupportedEngineFormats(hDoc, &pFormats, &nFormatsCount);

  if(nRet == SUCCESS)
  {
     for(L_INT i = 0; i < nFormatsCount; i++)
     {
        L_TCHAR * pszFormatName = NULL;
        L_INT nLength = 0;
        nRet = L_DocGetEngineFormatFriendlyName(hDoc, pFormats[i], NULL, &nLength);
        if(nRet == SUCCESS)
        {
         pszFormatName = (L_TCHAR*)GlobalAllocPtr(GHND, nLength * sizeof(L_TCHAR));
          if(pszFormatName)
          {
             L_DocGetEngineFormatFriendlyName(hDoc, pFormats[i], pszFormatName, &nLength);
             MessageBox(NULL, pszFormatName, TEXT("Supported Native Engine Formats"), MB_OK);
          }
        }
     }
     L_DocFreeEngineFormats(hDoc, &pFormats);
   }
   return nRet;
}