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



pageIndex
Specifies the index of the page for which information will be retrieved.
pageIndex
Specifies the index of the page for which information will be retrieved.
Gets information about the specified page in the OCR document.

Syntax

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

Parameters

pageIndex
Specifies the index of the page for which information will be retrieved.

Return Value

A RasterDocumentPageInfo structure which contains information about the specified page

Example

Visual BasicCopy Code
Public Sub GetPageInfoExample()
   ' 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 pageInfo As RasterDocumentPageInfo = New RasterDocumentPageInfo()
   pageInfo = rasterDocument.GetPageInfo(0)

   Dim buffer As String = String.Format("Page Width = {0}" & Constants.vbLf & "Page Height = {2}" & Constants.vbLf & "Page Bits Per Pixel = {4}", pageInfo.Size.Width, pageInfo.Size.Height, pageInfo.BitsPerPixel)
   MessageBox.Show(buffer)
   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void GetPageInfoExample() 

   // 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 
 
   RasterDocumentPageInfo pageInfo = new RasterDocumentPageInfo(); 
   pageInfo = rasterDocument.GetPageInfo(0); 
 
   string buffer = string.Format("Page Width = {0}\nPage Height = {2}\nPage Bits Per Pixel = {4}", pageInfo.Size.Width, pageInfo.Size.Height, pageInfo.BitsPerPixel); 
   MessageBox.Show(buffer); 
   rasterDocument.Shutdown(); 
}

Remarks

To get the number of pages of the OCR document, use the PageCount property. To recognize a page, call Recognize.
For more information, refer to Working with Pages.

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.