L_Doc2GetZone

#include "ltdoc2.h"

L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2GetZone(hDoc, 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 nPageIndex

Index of the page from which to get the zone information. This is a zero-based index.

L_INT nZoneIndex

Index of the zone for which to get the information. This is a zero-based index.

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 Doc2GetZoneExample(L_HDOC2 hDoc, 
                                        L_INT nPageIndex, 
                                        L_INT nZoneIndex) 
{ 
   L_INT nRet; 
   ZONEDATA2 ZoneData; 
   ZeroMemory(&ZoneData, sizeof(ZONEDATA2)); 
 
   nRet = L_Doc2GetZone(hDoc, 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_Doc2UpdateZone(hDoc, 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.1.15
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - OmniPage Engine C API Help