#include "ltdoc2.h"
L_LTDOC2_API L_INT L_Doc2FindDefaultFillMethodExt(hDoc, nDocId, nPageIndex, pFillMethod)
Gets the default fill method for all zones in the specified page.
Handle to the OCR document.
Document ID created by calling L_Doc2CreateDocument.
Zero-based page index.
Pointer to a DOC2_FILLMETHOD enumerated type to be updated with the default fill method.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
L_Doc2FindDefaultFillMethodExt tries to determine the type of content in the OCR zones of a page.
It 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. Call this function with NULL for the pFillMethod parameter to perform a zone-by-zone analysis (instead of suggesting a general filling type for the entire image). 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
L_INT Doc2FindDefaultFillMethodExampleExt(L_HDOC2 hDoc, L_INT nDocId, L_INT nPageIndex)
{
L_INT nRet;
DOC2_FILLMETHOD fm;
nRet = L_Doc2FindDefaultFillMethodExt(hDoc, nDocId, 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;
}