Leadtools.Document Deprecated as of v16. Refer to: Leadtools.Forms.Ocr | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
ImportZones Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : ImportZones Method



pageIndex
Specifies the index of the page into which the settings will be loaded. This is a zero-based index.
fileName
String contains the name of the zone file that contains the zones to import.
pageIndex
Specifies the index of the page into which the settings will be loaded. This is a zero-based index.
fileName
String contains the name of the zone file that contains the zones to import.
Imports the zone list from a zone file.

Syntax

Visual Basic (Declaration) 
Public Sub ImportZones( _
   ByVal pageIndex As Integer, _
   ByVal fileName As String _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim pageIndex As Integer
Dim fileName As String
 
instance.ImportZones(pageIndex, fileName)
C# 
public void ImportZones( 
   int pageIndex,
   string fileName
)
C++/CLI 
public:
void ImportZones( 
   int pageIndex,
   String^ fileName
) 

Parameters

pageIndex
Specifies the index of the page into which the settings will be loaded. This is a zero-based index.
fileName
String contains the name of the zone file that contains the zones to import.

Example

Visual BasicCopy Code
Public Sub ImportZonesExample()
   ' 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()
   'assume page is added, refer to AddPage example for more information

   Try
      rasterDocument.ImportZones(0, LeadtoolsExamples.Common.ImagesPath.Path + "zone.zon")
      MessageBox.Show("Imports the zone file into the specified page")
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try

   '...
   ' work with zones...
   '...
   ' exports page zone list to Zone file...
   rasterDocument.ExportZones(0, LeadtoolsExamples.Common.ImagesPath.Path + "zone.zon")
   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void ImportZonesExample() 

   // 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(); 
 
   try 
   { 
      // assume page is added, refer to AddPage example for more information 
 
      rasterDocument.ImportZones(0, LeadtoolsExamples.Common.ImagesPath.Path + "zone.zon"); 
      MessageBox.Show("Imports the zone file into the specified page"); 
 
      //... 
      // work with zones...  
      //... 
 
      // exports page zone list to Zone file...  
      rasterDocument.ExportZones(0, LeadtoolsExamples.Common.ImagesPath.Path + "zone.zon"); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message); 
   } 
   rasterDocument.Shutdown(); 
}

Remarks

Imports the zone list from a zone file into the specified page. Calling this method removes any zone list already attached to the specified page. To save the zone list to a file, call ExportZones.
For more information, refer to Working with Zones.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

The Leadtools.Document namespace is deprecated and no longer supported as of LEADTOOLS v16. For v16 and later, please refer to: Leadtools.Forms.Ocr. This documentation is retained for v15 and earlier informational use only.