VintaSoft Imaging .NET SDK v8.6
Vintasoft.Imaging.Pdf.Tree Namespace / PdfPageCollection Class
Members Example



In This Topic
    PdfPageCollection Class
    In This Topic
    Represents a collection of pages of PDF document.
    Object Model
    PdfPageCollection ClassPdfPage Class
    Syntax
    'Declaration
     
    <DefaultMemberAttribute("Item")>
    Public NotInheritable Class PdfPageCollection 
    [DefaultMember("Item")]
    public sealed class PdfPageCollection 
    [DefaultMember("Item")]
    public __gc __sealed class PdfPageCollection 
    [DefaultMember("Item")]
    public ref class PdfPageCollection sealed 
    Remarks
    Class allows to:

    Instance of this class cannot be created directly, it can be received only from the Vintasoft.Imaging.Pdf.PdfDocument object.

    Example
    This example shows how to add new blank pages to a PDF document.
    ''' <summary>
    ''' Adds a new empty page into PDF document.
    ''' </summary>
    ''' <param name="pdfFileName">The filename of PDF document.</param>
    ''' <param name="pageSize">The size of page.</param>
    Public Shared Sub AddEmptyPageToPdfDocument(pdfFileName As String, pageSize As System.Drawing.SizeF)
        ' open PDF document
        Using document As New Vintasoft.Imaging.Pdf.PdfDocument(pdfFileName)
            ' get the collection of pages of PDF document
            Dim pages As Vintasoft.Imaging.Pdf.Tree.PdfPageCollection = document.Pages
                
            ' add an empty page into collection of pages
            pages.Add(pageSize)
                
            ' save changes to a file
            document.SaveChanges()
        End Using
    End Sub
    /// <summary>
    /// Adds a new empty page into PDF document.
    /// </summary>
    /// <param name="pdfFileName">The filename of PDF document.</param>
    /// <param name="pageSize">The size of page.</param>
    public static void AddEmptyPageToPdfDocument(string pdfFileName, System.Drawing.SizeF pageSize)
    {
        // open PDF document
        using (Vintasoft.Imaging.Pdf.PdfDocument document = 
            new Vintasoft.Imaging.Pdf.PdfDocument(pdfFileName))
        {
            // get the collection of pages of PDF document
            Vintasoft.Imaging.Pdf.Tree.PdfPageCollection pages = document.Pages;
                
            // add an empty page into collection of pages
            pages.Add(pageSize);
                
            // save changes to a file
            document.SaveChanges();
        }
    }
    Inheritance Hierarchy

    System.Object
       Vintasoft.Imaging.Pdf.Tree.PdfPageCollection

    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also