Leadtools.Document Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
RemovePage Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : RemovePage Method




pageIndex
Index of the page to be deleted. This is a zero-based index
Removes the specified page from the OCR document.

Syntax

Visual Basic (Declaration) 
Public Sub RemovePage( _
   ByVal pageIndex As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim pageIndex As Integer
 
instance.RemovePage(pageIndex)
C# 
public void RemovePage( 
   int pageIndex
)
Managed Extensions for C++ 
public: void RemovePage( 
   int pageIndex
) 
C++/CLI 
public:
void RemovePage( 
   int pageIndex
) 

Parameters

pageIndex
Index of the page to be deleted. This is a zero-based index

Example

Visual BasicCopy Code
Public Sub RemovePageExample()
   ' 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

   Try
      rasterDocument.CleanupPages(True)
      rasterDocument.RemovePage(0)
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try
   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void RemovePageExample() 

   // 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 
 
   try 
   { 
      rasterDocument.CleanupPages(true); 
      rasterDocument.RemovePage(0); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message); 
   } 
   rasterDocument.Shutdown(); 
}

Remarks

To get the number of pages in the OCR document, use the PageCount property. To add one or more new pages, call AddPage.
For more information, refer to Working with Pages.

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