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



pageIndex
Page index. This index is zero-based.
pageIndex
Page index. This index is zero-based.
Finds the degree of orientation for the specified page.

Syntax

Visual Basic (Declaration) 
Public Function GetOrientationDegree( _
   ByVal pageIndex As Integer _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim pageIndex As Integer
Dim value As Integer
 
value = instance.GetOrientationDegree(pageIndex)
C# 
public int GetOrientationDegree( 
   int pageIndex
)
C++/CLI 
public:
int GetOrientationDegree( 
   int pageIndex
) 

Parameters

pageIndex
Page index. This index is zero-based.

Example

Visual BasicCopy Code
Public Sub GetOrientationDegreeExample()
   ' 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
   rasterDocument.Startup()
   'assume page is added, refer to AddPage example for more information
   Dim degree As Integer = rasterDocument.GetOrientationDegree(0)

   Dim msg As String = String.Format("Orientation degree = {0}", degree)
   MessageBox.Show(msg)

   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void GetOrientationDegreeExample() 

   // Note that this is a sample key, which will not work in your toolkit 
   RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey"); 
 
   RasterDocumentEngine rasterDocument; 
   rasterDocument = RasterDocumentEngine.Instance; 
   rasterDocument.Startup(); 
 
   // assume page is added, refer to AddPage example for more information 
 
   int degree = rasterDocument.GetOrientationDegree(0); 
 
   string msg = String.Format("Orientation degree = {0}", degree); 
   MessageBox.Show(msg); 
   rasterDocument.Shutdown(); 
}

Remarks

Detects whether the specified page needs to be oriented. If the specified page needs to be oriented, then the function will return the desired orientation degree; otherwise, the property will return 0. Also, the OCR engine can orient the page automatically by calling the AutoOrientPage 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.