Leadtools.Document Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
FindZones Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : FindZones Method




pageIndex
Specifies the index of the page to search. This is a zero-based index.
zoneArea
Specifies the zone area to be searched.
Finds all zones in the specified arae of the specified page.

Syntax

Visual Basic (Declaration) 
Public Sub FindZones( _
   ByVal pageIndex As Integer, _
   ByVal zoneArea As Rectangle _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim pageIndex As Integer
Dim zoneArea As Rectangle
 
instance.FindZones(pageIndex, zoneArea)
C# 
public void FindZones( 
   int pageIndex,
   Rectangle zoneArea
)
Managed Extensions for C++ 
public: void FindZones( 
   int pageIndex,
   Rectangle zoneArea
) 
C++/CLI 
public:
void FindZones( 
   int pageIndex,
   Rectangle zoneArea
) 

Parameters

pageIndex
Specifies the index of the page to search. This is a zero-based index.
zoneArea
Specifies the zone area to be searched.

Example

Visual BasicCopy Code
Public Sub FindZonesExample()
   ' Note that this is a sample key, which will not work in your toolkit
   RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey")

   Dim rasterDocument As RasterDocumentEngine
   rasterDocument = RasterDocumentEngine.Instance
   rasterDocument.Startup()

   rasterDocument.ShowZoneGridlines = True
   rasterDocument.EnableZoneForceSingleColumn = True
   rasterDocument.ZoneParser = RasterDocumentPageParser.Auto
   rasterDocument.FindZones(0, Rectangle.Empty)

   ' Note that this is a sample key, which will not work in your toolkit
   RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey")

   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void FindZonesExample() 

   // Note that this is a sample key, which will not work in your toolkit 
   RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey"); 
 
   RasterDocumentEngine rasterDocument; 
   rasterDocument = RasterDocumentEngine.Instance; 
   rasterDocument.Startup(); 
 
   // assume page is added, refer to AddPage example for more information 
 
   rasterDocument.ShowZoneGridlines = true; 
   rasterDocument.EnableZoneForceSingleColumn = true; 
   rasterDocument.ZoneParser = RasterDocumentPageParser.Auto; 
   rasterDocument.FindZones(0, Rectangle.Empty); 
 
   rasterDocument.Shutdown(); 
}

Remarks

The FindZones method is used for parsing the specified page (also called: auto-zoning), i.e. it analyzes the structure of the page layout and locates blocks for further processing. The method performs the analysis within the specified area of the image, which defined in the zoneArea parameter. It finds text or graphics blocks within the specified area, builds a zone list and then connects it to the specified page.
Zones found by this method are entered in a sequential list, called the zone list, which is attached to the specified page. When this method is called, any previously inserted zones are deleted from this list.
The GetZoneCount method can be used to retrieve the number of zones in the zone list. Zones can be deleted from this list by calling RemoveZone. You can get the zone parameters by calling GetZone method. After modifying some zone attributes, use the UpdateZone method to apply the changes to the zone.
This method finds the zone coordinates and the type of the zone. The zone type determines the role of the zone in the image layout and can be classified into three different groups:
New zones created by this method always take the value RasterDocumentCharacterFilter.Default, meaning that the zone will take on the global filter setting (which is by default RasterDocumentCharacterFilter.Default to have no filtering).
New zones located by this method always have the RasterDocumentFillMethod.Default and RasterDocumentRecognizeModule.Auto values in their RasterDocumentEngine.FillMethod and RasterDocumentZoneData.RecognizeModule properties, respectively. The "meaning" of the RasterDocumentFillMethod.Default filling method can be specified with the FillMethod property.
On the other hand, there is no similar method for specifying the default recognition module.
New zones created by this method always have empty strings in their SectionName property, which specifies the use of the default section of any enabled User dictionary.
The GetDefaultFillMethod method can be used when you don't know the type of page to be processed. The following properties are used when finding zones: For more information, refer to Working with Zones.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Documentrequires a Document or Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features