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
EnginePath Property
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : EnginePath Property



Gets or sets the path to the folder containing the OCR engine files.

Syntax

Visual Basic (Declaration) 
Public Shared Property EnginePath As String
Visual Basic (Usage)Copy Code
Dim value As String
 
RasterDocumentEngine.EnginePath = value
 
value = RasterDocumentEngine.EnginePath
C# 
public static string EnginePath {get; set;}
C++/CLI 
public:
static property String^ EnginePath {
   String^ get();
   void set (String^ value);
}

Return Value

The path to the folder containing the OCR engine files.

Example

Visual BasicCopy Code
Public Sub EnginePathExample()
   ' 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

   ' Assume that you copied the LEADTOOLS OCR Module files from "LEADTOOLS"\Redist\Ocr to C:\MyApp\Ocr
   ' Tell LEADTOOLS where to look for the OCR engine files in the new location
   RasterDocumentEngine.EnginePath = LeadtoolsExamples.Common.ImagesPath.Path + "Ocr"
   Try
      rasterDocument.Startup()
      '...
      '...
      rasterDocument.Shutdown()
   Catch e1 As Exception
      ' Handle error here
   End Try
End Sub
C#Copy Code
public void EnginePathExample(RasterDocumentEngine ocr) 

   // Tell LEADTOOLS where to look for the OCR engine files in the new location 
   // Assume that you copied the LEADTOOLS OCR Module files from "LEADTOOLS"\Redist\Ocr to C:\MyApp\Ocr 
   RasterDocumentEngine.EnginePath = @"C:\MyApp\Ocr"; 
   try 
   { 
      ocr.Startup(); 
   } 
   catch(Exception) 
   { 
      // Handle error here 
   } 
}

Remarks

The LEADTOOLS OCR Module setup will install the OCR engine files by default to "Installation Path\Bin\Common\OCR" where Installation Path is the root folder where the LEADTOOLS for .NET Class Library is installed (for example, C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 16.5).

If you leave this property empty (or with a null or Nothing in Visual Basic), the LEADTOOLS OCR engine will look for these extra files in the default installation folder specified above.

When you are ready to package your application, you might want to change the location where the LEADTOOLS OCR engine looks for these extra files. You can use this property to do that. Set the path you want before calling the Startup method.

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.