LEADTOOLS OCR (Leadtools.Forms.Ocr assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
Startup Method
See Also 
Leadtools.Forms.Ocr Namespace > IOcrEngine Interface : Startup Method



rasterCodecs
Optional instance of a Leadtools.Codecs.RasterCodecs object to be used when loading image files from disk inside the engine. You can pass your own initialized instance of Leadtools.Codecs.RasterCodecs to be used. The same object will then be used internally by the OCR engine when loading raster image files. Otherwise, pass null (Nothing in Visual Basic) and the IOcrEngine will create and use its own version of Leadtools.Codecs.RasterCodecs when needed. Refer to RasterCodecsInstance for more information on how this parameter is used by the OCR engine during its lifetime, refer to OCR Engine and RasterCodecs/DocumentWriter Usage.
documentWriter
Optional instance of a Leadtools.Forms.DocumentWriters.DocumentWriter object to be used when saving OCR documents to disk inside the engine. You can pass your own initialized instance of Leadtools.Forms.DocumentWriters.DocumentWriter to be used. The same object will then be used internally by the OCR engine when saving OCR documents to disk. Otherwise, pass null (Nothing in Visual Basic) and the IOcrEngine will create and use its own version of Leadtools.Forms.DocumentWriters.DocumentWriter when needed. Refer to IOcrEngine.DocumentWriterInstance for more information on how this parameter is used by the OCR engine during its lifetime, refer to OCR Engine and RasterCodecs/DocumentWriter Usage.
workDirectory

Optional path to a directory to be used when the engine saves temporary files. The IOcrEngine object will create various temporary files during recognition and document saving processes. It will use the path passed in workDirectory as the location where these temporary files will be created. You can pass null (Nothing in Visual Basic) to let the engine select the temporary directory of the current logged in user (TEMP).

In either case, the value of working directory of the current started IOcrEngine can be obtained through the Leadtools.Forms.Ocr.IOcrEngine.WorkDirectory property.

The engine automatically deletes any temporary files created. However, if an unexpected error occurs (for example, an unhandled exception), some temporary files may still reside in the work directory after the application exits. A typical application may use a custom directory inside the application path and manually deletes any files that may reside there before calling Startup in case the previous instance of the application exited abnormally.

If the value of the workDirectory parameter is not null (Nothing in Visual Basic), then it must refer to a valid directory that exists in the system and the process that created the engine must have enough access rights to read, write and delete files from this directory.

startupParameters
Optional startup parameter. The value of this parameter depends on the type of this IOcrEngine as follows:
Engine startupParameters
OcrEngineType.Advantage

The path to the folder containing the OCR engine files.

By default, during setup the LEADTOOLS OCR Module setup installs the OCR engine files to "Installation Path\Bin\Common\OcrAdvantageRuntime" 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 17).

If you pass null (Nothing in Visual Basic) to startupParameters, then 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.

OcrEngineType.Plus

The path to the folder containing the OCR engine files.

By default, during setup the LEADTOOLS OCR Module setup installs the OCR engine files to "Installation Path\Bin\Common\OcrPlusRuntime" 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 17).

If you pass null (Nothing in Visual Basic) to startupParameters, then 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.

OcrEngineType.Professional

The path to the folder containing the OCR engine files.

By default, during setup the LEADTOOLS OCR Module setup installs the OCR engine files to "Installation Path\Bin\Common\OcrProfessionalRuntime" 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 17).

If you pass null (Nothing in Visual Basic) to startupParameters, then 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.

The Startup Method is available as an add-on to the LEADTOOLS Document and Medical Imaging toolkits.

rasterCodecs
Optional instance of a Leadtools.Codecs.RasterCodecs object to be used when loading image files from disk inside the engine. You can pass your own initialized instance of Leadtools.Codecs.RasterCodecs to be used. The same object will then be used internally by the OCR engine when loading raster image files. Otherwise, pass null (Nothing in Visual Basic) and the IOcrEngine will create and use its own version of Leadtools.Codecs.RasterCodecs when needed. Refer to RasterCodecsInstance for more information on how this parameter is used by the OCR engine during its lifetime, refer to OCR Engine and RasterCodecs/DocumentWriter Usage.
documentWriter
Optional instance of a Leadtools.Forms.DocumentWriters.DocumentWriter object to be used when saving OCR documents to disk inside the engine. You can pass your own initialized instance of Leadtools.Forms.DocumentWriters.DocumentWriter to be used. The same object will then be used internally by the OCR engine when saving OCR documents to disk. Otherwise, pass null (Nothing in Visual Basic) and the IOcrEngine will create and use its own version of Leadtools.Forms.DocumentWriters.DocumentWriter when needed. Refer to IOcrEngine.DocumentWriterInstance for more information on how this parameter is used by the OCR engine during its lifetime, refer to OCR Engine and RasterCodecs/DocumentWriter Usage.
workDirectory

Optional path to a directory to be used when the engine saves temporary files. The IOcrEngine object will create various temporary files during recognition and document saving processes. It will use the path passed in workDirectory as the location where these temporary files will be created. You can pass null (Nothing in Visual Basic) to let the engine select the temporary directory of the current logged in user (TEMP).

In either case, the value of working directory of the current started IOcrEngine can be obtained through the Leadtools.Forms.Ocr.IOcrEngine.WorkDirectory property.

The engine automatically deletes any temporary files created. However, if an unexpected error occurs (for example, an unhandled exception), some temporary files may still reside in the work directory after the application exits. A typical application may use a custom directory inside the application path and manually deletes any files that may reside there before calling Startup in case the previous instance of the application exited abnormally.

If the value of the workDirectory parameter is not null (Nothing in Visual Basic), then it must refer to a valid directory that exists in the system and the process that created the engine must have enough access rights to read, write and delete files from this directory.

startupParameters
Optional startup parameter. The value of this parameter depends on the type of this IOcrEngine as follows:
Engine startupParameters
OcrEngineType.Advantage

The path to the folder containing the OCR engine files.

By default, during setup the LEADTOOLS OCR Module setup installs the OCR engine files to "Installation Path\Bin\Common\OcrAdvantageRuntime" 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 17).

If you pass null (Nothing in Visual Basic) to startupParameters, then 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.

OcrEngineType.Plus

The path to the folder containing the OCR engine files.

By default, during setup the LEADTOOLS OCR Module setup installs the OCR engine files to "Installation Path\Bin\Common\OcrPlusRuntime" 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 17).

If you pass null (Nothing in Visual Basic) to startupParameters, then 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.

OcrEngineType.Professional

The path to the folder containing the OCR engine files.

By default, during setup the LEADTOOLS OCR Module setup installs the OCR engine files to "Installation Path\Bin\Common\OcrProfessionalRuntime" 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 17).

If you pass null (Nothing in Visual Basic) to startupParameters, then 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.

Starts the OCR engine.

Syntax

Visual Basic (Declaration) 
Sub Startup( _
   ByVal rasterCodecs As RasterCodecs, _
   ByVal documentWriter As DocumentWriter, _
   ByVal workDirectory As String, _
   ByVal startupParameters As String _
) 
Visual Basic (Usage)Copy Code
Dim instance As IOcrEngine
Dim rasterCodecs As RasterCodecs
Dim documentWriter As DocumentWriter
Dim workDirectory As String
Dim startupParameters As String
 
instance.Startup(rasterCodecs, documentWriter, workDirectory, startupParameters)

Parameters

rasterCodecs
Optional instance of a Leadtools.Codecs.RasterCodecs object to be used when loading image files from disk inside the engine. You can pass your own initialized instance of Leadtools.Codecs.RasterCodecs to be used. The same object will then be used internally by the OCR engine when loading raster image files. Otherwise, pass null (Nothing in Visual Basic) and the IOcrEngine will create and use its own version of Leadtools.Codecs.RasterCodecs when needed. Refer to RasterCodecsInstance for more information on how this parameter is used by the OCR engine during its lifetime, refer to OCR Engine and RasterCodecs/DocumentWriter Usage.
documentWriter
Optional instance of a Leadtools.Forms.DocumentWriters.DocumentWriter object to be used when saving OCR documents to disk inside the engine. You can pass your own initialized instance of Leadtools.Forms.DocumentWriters.DocumentWriter to be used. The same object will then be used internally by the OCR engine when saving OCR documents to disk. Otherwise, pass null (Nothing in Visual Basic) and the IOcrEngine will create and use its own version of Leadtools.Forms.DocumentWriters.DocumentWriter when needed. Refer to IOcrEngine.DocumentWriterInstance for more information on how this parameter is used by the OCR engine during its lifetime, refer to OCR Engine and RasterCodecs/DocumentWriter Usage.
workDirectory

Optional path to a directory to be used when the engine saves temporary files. The IOcrEngine object will create various temporary files during recognition and document saving processes. It will use the path passed in workDirectory as the location where these temporary files will be created. You can pass null (Nothing in Visual Basic) to let the engine select the temporary directory of the current logged in user (TEMP).

In either case, the value of working directory of the current started IOcrEngine can be obtained through the Leadtools.Forms.Ocr.IOcrEngine.WorkDirectory property.

The engine automatically deletes any temporary files created. However, if an unexpected error occurs (for example, an unhandled exception), some temporary files may still reside in the work directory after the application exits. A typical application may use a custom directory inside the application path and manually deletes any files that may reside there before calling Startup in case the previous instance of the application exited abnormally.

If the value of the workDirectory parameter is not null (Nothing in Visual Basic), then it must refer to a valid directory that exists in the system and the process that created the engine must have enough access rights to read, write and delete files from this directory.

startupParameters
Optional startup parameter. The value of this parameter depends on the type of this IOcrEngine as follows:
Engine startupParameters
OcrEngineType.Advantage

The path to the folder containing the OCR engine files.

By default, during setup the LEADTOOLS OCR Module setup installs the OCR engine files to "Installation Path\Bin\Common\OcrAdvantageRuntime" 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 17).

If you pass null (Nothing in Visual Basic) to startupParameters, then 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.

OcrEngineType.Plus

The path to the folder containing the OCR engine files.

By default, during setup the LEADTOOLS OCR Module setup installs the OCR engine files to "Installation Path\Bin\Common\OcrPlusRuntime" 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 17).

If you pass null (Nothing in Visual Basic) to startupParameters, then 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.

OcrEngineType.Professional

The path to the folder containing the OCR engine files.

By default, during setup the LEADTOOLS OCR Module setup installs the OCR engine files to "Installation Path\Bin\Common\OcrProfessionalRuntime" 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 17).

If you pass null (Nothing in Visual Basic) to startupParameters, then 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.

Example

The following example assumes you copied the OCR engine runtime files to C:\MyApp\Ocr.

Remarks

The Startup method must be called before invoking any other methods or properties in this IOcrEngine.

To check if the engine is started, use the Leadtools.Forms.Ocr.IOcrEngine.IsStarted property.

You must call Leadtools.Forms.Ocr.IOcrEngine.Shutdown to shut down the engine and free the memory and resources used.

You can call the Startup method multiple times, only the first call will start the engine while subsequent calls will only increment an internal counter. You must call Leadtools.Forms.Ocr.IOcrEngine.Shutdown for each Startup called.

The IOcrEngine interface implements System.IDisposable. It is highly recommended that you call System.IDisposable.Dispose (or use the using statement in C# or Using statement in Visual Basic) when creating the IOcrEngine instance. The System.IDisposable.Dispose method will automatically shuts down the engine if it has been started.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

Startup requires an OCR module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features