L_Doc2GetZoneExt

#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.

Parameters

L_HDOC2 hDoc

Handle to the OCR document

L_INT nDocId

Document ID created by calling L_Doc2CreateDocument.

L_INT nPageIndex

Zero-based index of the page from which to get the zone information.

L_INT nZoneIndex

Zero-based index of the zone for which to get the information.

pZONEDATA2 pZoneData

Pointer to a ZONEDATA2 structure that will be updated with zone information.

L_UINT uStructSize

Size in bytes, of the structure pointed to by pZoneData. Use sizeof(ZONEDATA2) to calculate this value.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

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

See Also

Functions

Topics

Example

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; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - OmniPage Engine C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.