Leadtools.Document Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
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 
Managed Extensions for C++ 
[SerializableAttribute()]
public __gc class RasterDocumentException : public 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 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Documentrequires a Document or Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features