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
RasterDocumentException Class
See Also  Members   Example 
Leadtools.Document Namespace : RasterDocumentException Class



The exception that is thrown when an OCR error occurs.

Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class RasterDocumentException 
   Inherits LeadtoolsException
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentException
C# 
[SerializableAttribute()]
public class RasterDocumentException : LeadtoolsException 
C++/CLI 
[SerializableAttribute()]
public ref class RasterDocumentException : public LeadtoolsException 

Example

Visual BasicCopy Code
Public Sub RasterDocumentExceptionExample()
   ' startup and shutdown the OCR engine

   Try
      Dim ocr As RasterDocumentEngine
      ocr = RasterDocumentEngine.Instance
      ocr.Startup()

      ' ...

      ocr.Shutdown()
   Catch ex As RasterDocumentException
      ' ocr error, show the code and message
      MessageBox.Show(String.Format("OCR Error.{0}Code: {1}{0}Message: {2}", Environment.NewLine, ex.Code, ex.Message))
   Catch ex As Exception
      ' other errors
      MessageBox.Show(String.Format("General error: {0}", ex.Message))
   End Try
End Sub
C#Copy Code
public void RasterDocumentExceptionExample() 

   // startup and shutdown the OCR engine 
 
   try 
   { 
      RasterDocumentEngine ocr; 
      ocr = RasterDocumentEngine.Instance; 
      ocr.Startup(); 
 
      //... 
      ocr.Shutdown(); 
   } 
   catch(RasterDocumentException ex) 
   { 
      // ocr error, show the code and message 
      MessageBox.Show(string.Format("OCR Error.{0}Code: {1}{0}Message: {2}", Environment.NewLine, ex.Code, ex.Message)); 
   } 
   catch(Exception ex) 
   { 
      // other errors 
      MessageBox.Show(string.Format("General error: {0}", ex.Message)); 
   } 
}

Remarks

The RasterDocumentException class defines a Code property that you can examine to determine what caused the error.

Inheritance Hierarchy

System.Object
   System.Exception
      Leadtools.LeadtoolsException
         Leadtools.Document.RasterDocumentException

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.