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




pageIndex
Index of the page to be updated. This is a zero-based index.
Exports the specified page to an Image object.

Syntax

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

Parameters

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

Return Value

If successful, returns the exported page as an RasterImage object.

Example

Visual BasicCopy Code
Public Sub ExportPageExample()
   ' Load an image
   RasterCodecs.Startup()
   Dim codecs As RasterCodecs = New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim image As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\ocr1.tif")

   ' 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
      ' export page...
      image = rasterDocument.ExportPage(0)
      MessageBox.Show("The engine exported the specified page")
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try

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

   // Load an image 
   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\ocr1.tif"); 
 
   // 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 
   { 
      // export page... 
      image = rasterDocument.ExportPage(0); 
      MessageBox.Show("The engine exported the specified page"); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message); 
   } 
 
   rasterDocument.Shutdown(); 
   RasterCodecs.Shutdown(); 
}

Remarks

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