Search Results for

    Show / Hide Table of Contents

    Class PdfPagesCollection

    Manages the collection of pages within a PDF document. Supports iteration, addition, removal, and direct access to individual pages.

    Access this collection via Pages property. The collection provides full control over document structure including page manipulation.

    Example - Work with pages:

    var pdf = PdfDocument.FromFile("document.pdf");
    

    // Iterate pages: foreach (var page in pdf.Pages) Console.WriteLine($"Page {page.PageIndex}: {page.Width}x{page.Height}");

    // Access specific page: var firstPage = pdf.Pages[0]; var lastPage = pdf.Pages[pdf.PageCount - 1];

    // Remove page: pdf.Pages.RemoveAt(2); // Remove page 3

    // Get page count: int totalPages = pdf.Pages.Count;

    Inheritance
    System.Object
    PdfPagesCollection
    Implements
    IPdfPageCollection
    IronSoftware.Abstractions.Absolute.IDocumentPageCollection<IPdfPage>
    System.Collections.Generic.IReadOnlyCollection<IPdfPage>
    System.Collections.Generic.IEnumerable<IPdfPage>
    System.Collections.IEnumerable
    Namespace: IronPdf.Pages
    Assembly: IronPdf.dll
    Syntax
    public class PdfPagesCollection : ObservableCollection<IPdfPage>, IPdfPageCollection, IDocumentPageCollection<IPdfPage>, IReadOnlyCollection<IPdfPage>, IEnumerable<IPdfPage>, IEnumerable
    Remarks

    Key Operations:

    Page indexes are zero-based (Page 1 = Index 0).

    Related Resources:

    Methods

    Add(PdfPage)

    Declaration
    public void Add(PdfPage item)
    Parameters
    Type Name Description
    PdfPage item

    Clear()

    Declaration
    public void Clear()

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    RefreshPages()

    Declaration
    public void RefreshPages()

    Remove(IPdfPage)

    Declaration
    public bool Remove(IPdfPage item)
    Parameters
    Type Name Description
    IPdfPage item
    Returns
    Type Description
    System.Boolean

    Remove(PdfPage)

    Declaration
    public bool Remove(PdfPage item)
    Parameters
    Type Name Description
    PdfPage item
    Returns
    Type Description
    System.Boolean

    RemoveAt(Int32)

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    Implements

    IPdfPageCollection
    IronSoftware.Abstractions.Absolute.IDocumentPageCollection<>
    System.Collections.Generic.IReadOnlyCollection<>
    System.Collections.Generic.IEnumerable<>
    System.Collections.IEnumerable

    See Also

    PdfPage
    Pages
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronPDF to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronPDF free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.