L_Doc2FindDefaultFillMethod

#include "ltdoc2.h"

L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2FindDefaultFillMethod(hDoc, nPageIndex, pFillMethod)

L_HDOC2 hDoc;

/* handle to the OCR document */

L_INT nPageIndex;

/* page index */

DOC2_FILLMETHOD * pFillMethod;

/* pointer to default fill method */

Gets the default fill method for the specified page.

Parameter

Description

hDoc

Handle to the OCR document.

nPageIndex

Specify the page index. This is a zero-based index.

pFillMethod

Pointer to a DOC2_FILLMETHOD enumerated type to be updated with the default fill method.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Gets the global fill method of all zones in the specified page.

This function tries to determine the type of content in the OCR zones of a page.

The function only looks into zones with the DOC2_FILL_DEFAULT value in their ZONEDATA2.FillMethod field. The detected fill method is updated in the pFillMethod variable. If you call this function with NULL for the pFillMethod parameter, the function performs a zone-by-zone analysis (instead of suggesting a general filling type for the entire image), and if the algorithm can determine a type for a given zone, the function replaces the DOC2_FILL_DEFAULT value in the zone's ZONEDATA2.FillMethod field by the determined one.

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_Doc2GetFillMethod, L_Doc2SetFillMethod, L_Doc2CleanupPages

Topics:

OCR Functions: Pages

 

Working with Pages

Example

L_LTDOC2TEX_API  L_INT Doc2FindDefaultFillMethodExample(L_HDOC2 hDoc,L_INT nPageIndex)
{
   L_INT nRet;
   DOC2_FILLMETHOD fm;
   nRet = L_Doc2FindDefaultFillMethod(hDoc, nPageIndex, &fm);
   if (nRet != SUCCESS)
      return nRet;

   if (fm == DOC2_FILL_OMR)
      MessageBox(NULL, TEXT("The Default Fill Method that is used in the specified page is Fill OMR."), TEXT("Notice!"), MB_OK);
   return SUCCESS;
}