#include "ltdoc2.h"
L_LTDOC2_API L_INT L_Doc2GetZoneExt(hDoc, nDocId, nPageIndex, nZoneIndex, pZoneData, uStructSize)
Gets information about the zone at the specified index in the zone list of the specified page.
Handle to the OCR document
Document ID created by calling L_Doc2CreateDocument.
Zero-based index of the page from which to get the zone information.
Zero-based index of the zone for which to get the information.
Pointer to a ZONEDATA2 structure that will be updated with zone information.
Size in bytes, of the structure pointed to by pZoneData. Use sizeof(ZONEDATA2) to calculate this value.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To remove a specific zone, call the L_Doc2RemoveZone / L_Doc2RemoveZoneExt function.
To add a zone, call the L_Doc2AddZone / L_Doc2AddZoneExt function.
Required DLLs and Libraries
L_INT Doc2GetZoneExampleExt(L_HDOC2 hDoc, L_INT nDocId, L_INT nPageIndex, L_INT nZoneIndex)
{
L_INT nRet;
ZONEDATA2 ZoneData;
ZeroMemory(&ZoneData, sizeof(ZONEDATA2));
nRet = L_Doc2GetZoneExt(hDoc, nDocId, nPageIndex, nZoneIndex, &ZoneData, sizeof(ZONEDATA2));
if (nRet != SUCCESS)
{
MessageBox(NULL, TEXT("Couldn't get the specified zone information."), TEXT("Error!"), MB_OK);
return nRet;
}
if (ZoneData.FillMethod != DOC2_FILL_OCRA)
ZoneData.FillMethod = DOC2_FILL_OCRA;
if (ZoneData.Type != DOC2_ZONE_GRAPHIC)
ZoneData.Type = DOC2_ZONE_GRAPHIC;
nRet = L_Doc2UpdateZoneExt(hDoc, nDocId, nPageIndex, nZoneIndex, &ZoneData);
if (nRet == SUCCESS)
MessageBox(NULL, TEXT("The specified zone is updated."), TEXT("Notice!"), MB_OK);
else
return nRet;
return SUCCESS;
}