LEADTOOLS OCR (Leadtools.Forms.Ocr assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
OcrException Class
See Also  Members  
Leadtools.Forms.Ocr Namespace : OcrException Class



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

The exception that is thrown when a runtime error occurs inside the IOcrEngine

Object Model

OcrException Class

Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class OcrException 
   Inherits System.Exception
   Implements _ExceptionISerializable 
Visual Basic (Usage)Copy Code
Dim instance As OcrException
C# 
[SerializableAttribute()]
public class OcrException : System.Exception, _ExceptionISerializable  
C++/CLI 
[SerializableAttribute()]
public ref class OcrException : public System.Exception, _ExceptionISerializable  

Example

This example shows how to trap various types of exceptions during OCR operations.

Remarks

When a runtime error occurs in the IOcrEngine, an exception of type OcrException is thrown with the engine-specific error code set in the Code member. This error code is engine-specific but a short description can be obtained using the System.Exception.Message property of this class or by using the IOcrEngine.GetErrorCodeString method.

Logic errors such as invalid parameters to methods or invalid operations throw standard .NET exceptions (in this case, System.ArgumentException and System.InvalidOperationException respectively Errors caused by loading invalid image files using IOcrEngine.RasterCodecsInstance will throw exceptions of type Leadtools.RasterException. Errors for missing features (support locked) will throw OcrSupportLockedException exceptions. Any other runtime error in the engine will throw an OcrException.

Inheritance Hierarchy

System.Object
   System.Exception
      Leadtools.Forms.Ocr.OcrException

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

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