L_DocEnumOutputFileFormats

#include "ltdoc.h"

L_INT EXT_FUNCTION L_DocEnumOutputFileFormats(hDoc, pfnCallback, pUserData)

L_HDOC hDoc;

/* handle to the OCR document */

ENUMOUTPUTFILEFORMATS pfnCallback;

/* callback function */

L_VOID L_FAR * pUserData;

/* pointer to more parameters for the callback */

Enumerate all available output file formats in the OCR document engine.

Parameter

Description

hDoc

Handle to the OCR document.

pfnCallback

Callback function for returning available output file formats.

 

L_DocEnumOutputFileFormats calls this callback function as it enumerates the available output formats.

 

The callback function must adhere to the following function prototype: ENUMOUTPUTFILEFORMATS.

pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

 

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer to the appropriate data type to access your variable or structure.

 

If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Finds all available output text formats and reports them by calling the ENUMOUTPUTFILEFORMATS callback.

To get the format information for each format, call L_DocGetTextFormatInfo.

This function can be used to determine the available output file formats in the OCR document enginefor saving the recognition results.

To recognize a page(s), call L_DocRecognize.

To save the recognition results to a file, call L_DocSaveResultsToFile.

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_DocGetStatus, L_DocRecognize, L_DocSaveResultsToMemory, L_DocFreeMemoryResults, L_DocSetRecognitionResultOptions, L_DocGetRecognitionResultOptions, L_DocGetTextFormatInfo, L_DocSaveResultsToFile, L_DocSetSpecialChar, L_DocGetSpecialChar, L_DocGetRecognizedCharacters, L_DocSetRecognizedCharacters, L_DocFreeRecognizedCharacters, ENUMOUTPUTFILEFORMATS

Topics:

OCR Functions: Recognition

 

Recognizing Document Pages

Example

L_HDOC hDoc;
L_INT EXT_FUNCTION EnumOutputFileFormats(FORMAT_TYPE Format, L_VOID L_FAR * pUserData)
{
   if (Format == DOC_RTF_WORD_2000)
   {
      TEXTFORMATINFO FormatInfo;

      memset(&FormatInfo, 0, sizeof(TEXTFORMATINFO));
      L_INT nRet = L_DocGetTextFormatInfo(hDoc, Format, &FormatInfo, sizeof(TEXTFORMATINFO));
      if (nRet == SUCCESS)
      {
         L_TCHAR szBuffer[1024];

         memset(szBuffer, 0, sizeof(szBuffer));
         wsprintf(szBuffer, TEXT("Format Name = %s\nFormat DLL Name = %s\nFormat Ext = %s\n"),
                  FormatInfo.pszName,
                  FormatInfo.pszDLLName,
                  FormatInfo.pszExtName);

         MessageBox(NULL, szBuffer, TEXT("Notice!"), MB_OK);
      }
   }

   return SUCCESS;
}

void TestOutputFileFormats()
{
   L_DocEnumOutputFileFormats(hDoc, EnumOutputFileFormats, NULL);
}