ImageGear for .NET
ImGearDocumentPageArray Class
Members  Example 




Represents a collection of pages within ImGearDocument object.
Object Model
ImGearDocumentPageArray ClassImGearPage Class
Syntax
'Declaration
 
<DefaultMemberAttribute("Item")>
Public Class ImGearDocumentPageArray 
'Usage
 
Dim instance As ImGearDocumentPageArray
[DefaultMemberAttribute("Item")]
public class ImGearDocumentPageArray 
[DefaultMemberAttribute("Item")]
public __gc class ImGearDocumentPageArray 
[DefaultMemberAttribute("Item")]
public ref class ImGearDocumentPageArray 
Remarks
On adding pages, checks that the new page is not attached to any other document. The Remove method detaches a page from the document. If it is referenced from anywhere else, it remains a valid stand-alone page.

Well-formed page array may contain any number of null entries. An exception is made for the formats where pages are physically continuous (i.e., PDF). Note that setting a page to null is different from removing a page from the document - the former does not change page count, whereas the latter does.

Example
int pageCount;
ImGearDocument igDocument;
using (FileStream localFile = new FileStream(localFilePath, FileMode.Open))
{
    pageCount = ImGearFileFormats.GetPageCount(localFile, ImGearFormats.UNKNOWN);
    igDocument = ImGearFileFormats.LoadDocument(localFile, 0, pageCount);
}

//Check pages swap possibility
if (pageCount > 1)
{
    ImGearPage igPage = igDocument.Pages[0];
    igDocument.Pages.Remove(igPage);
    igDocument.Pages.Insert(1, igPage);
}
Dim pageCount As Integer
Dim igDocument As ImGearDocument
Dim localFile As FileStream = New FileStream(localFilePath, FileMode.Open)
Try
    pageCount = ImGearFileFormats.GetPageCount(localFile, ImGearFormats.UNKNOWN)
    igDocument = ImGearFileFormats.LoadDocument(localFile, 0, pageCount)
Finally
    localFile.Close()
End Try

'Check pages swap possibility
If (pageCount > 1) Then
    Dim igPage As ImGearPage = igDocument.Pages(0)
    igDocument.Pages.Remove(igPage)
    igDocument.Pages.Insert(1, igPage)
End If
Inheritance Hierarchy

System.Object
   ImageGear.Core.ImGearDocumentPageArray
      ImageGear.Formats.PDF.ImGearPDFDocumentPageArray

See Also

Reference

ImGearDocumentPageArray Members
ImageGear.Core Namespace

 

 


©2014. Accusoft Corporation. All Rights Reserved.

Send Feedback