Support for determining the various zone types, recognition modules and fill methods supported by the OCR engine.
public interface IOcrZoneManager Public Interface IOcrZoneManager public interface IOcrZoneManager @interface LTOcrZoneManager : NSObject public class OcrZoneManager function Leadtools.Forms.Ocr.IOcrZoneManager() public interface class IOcrZoneManager You can access the instance of the IOcrZoneManager used by an IOcrEngine through the IOcrEngine.ZoneManager property.
When calling the IOcrPage.AutoZone method on a page, the generated zone's type (OcrZone.ZoneType) will always be one of the supported values as reported by the IOcrZoneManager.
Before manually changing any of the above zone properties, you must determine whether the particular value is supported by this instance of IOcrEngine by using IsZoneTypeSupported first.
To get all the supported zone types use GetSupportedZoneTypes.
This example will show the different zone types supported by the Advantage OCR engine.
using Leadtools;using Leadtools.Codecs;using Leadtools.Forms.Ocr;using Leadtools.Forms;using Leadtools.Forms.DocumentWriters;using Leadtools.WinForms;public void ZoneManagerExample(){// Create an instance of the engineusing (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false)){// Start the engine using default parametersocrEngine.Startup(null, null, null, LEAD_VARS.OcrAdvantageRuntimeDir);// Get the zone managerIOcrZoneManager ocrZoneManager = ocrEngine.ZoneManager;// Show all the zone types supported by this engineConsole.WriteLine("Hit enter to show the supported zone types");//Console.ReadLine();OcrZoneType[] zoneTypes = ocrZoneManager.GetSupportedZoneTypes();Console.WriteLine("Supported zone types:");Console.WriteLine("---------------------");foreach (OcrZoneType zoneType in zoneTypes)Console.WriteLine(" {0}", zoneType);// Shutdown the engine// Note: calling Dispose will also automatically shutdown the engine if it has been startedocrEngine.Shutdown();}}static class LEAD_VARS{public const string OcrAdvantageRuntimeDir = @"C:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.Forms.OcrImports Leadtools.FormsImports Leadtools.Forms.DocumentWritersImports Leadtools.WinFormsPublic Sub ZoneManagerExample()' Create an instance of the engineUsing ocrEngine As IOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, False)' Start the engine using default parametersocrEngine.Startup(Nothing, Nothing, Nothing, LEAD_VARS.OcrAdvantageRuntimeDir)' Get the zone managerDim ocrZoneManager As IOcrZoneManager = ocrEngine.ZoneManager' Show all the zone types supported by this engineConsole.WriteLine("Hit enter to show the supported zone types")Console.ReadLine()Dim zoneTypes As OcrZoneType() = ocrZoneManager.GetSupportedZoneTypes()Console.WriteLine("Supported zone types:")Console.WriteLine("---------------------")For Each zoneType As OcrZoneType In zoneTypesConsole.WriteLine(" {0}", zoneType)Next' Shutdown the engine' Note: calling Dispose will also automatically shutdown the engine if it has been startedocrEngine.Shutdown()End UsingEnd SubPublic NotInheritable Class LEAD_VARSPublic Const OcrAdvantageRuntimeDir As String = "C:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime"End Class
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
