Skip to main content

PdfDocument.Pages Property

Obtains to the collection of document pages.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v23.2.Core.dll

NuGet Package: DevExpress.Pdf.Core


public IList<PdfPage> Pages { get; }

Property Value

Type Description

A collection of PdfPage objects.


The Pages property obtian a list of document pages. Access a specific page by its index.

Add a New Page

Use the following API to append or insert a new page:

Method Description
PdfDocumentProcessor.AddNewPage Appends an empty page.
PdfDocumentProcessor.InsertNewPage Inserts a page at a specified position (page number).

The following code adds a new page to a document:

using DevExpress.Pdf;

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())

Copy a Page from Another Document

The Insert(Int32, T) method allows you to add an extracted page to another PDF file. When you add a page from another document, all page content, including bookmarks referring to this page, is copied to the resulting document.

The code sample below copies a page from one PDF document to another.

View Example: How to copy a page from one document to another

using DevExpress.Pdf;

using (PdfDocumentProcessor source = new PdfDocumentProcessor())
    using (PdfDocumentProcessor target = new PdfDocumentProcessor())
        target.Document.Pages.Insert(3, source.Document.Pages[0]);

Extract a Page

Use the Add(T) method to add pages to the collection. When you add a page from another document, all page content, including bookmarks referring to this page, is copied to the resulting document.

View Example

using DevExpress.Pdf;

using (PdfDocumentProcessor source = new PdfDocumentProcessor())
    using (PdfDocumentProcessor target = new PdfDocumentProcessor())

Delete a Page

Call the PdfDocumentProcessor.DeletePage method to remove a page from a document. The PdfDocumentProcessor.DeletePages method removes a list of pages form a document.

The code sample below deletes odd-numbered pages in a document, starting with the last odd-numbered page.

View Example: Delete Pages from PDF

using DevExpress.Pdf;

using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
  for (int i = pdfDocumentProcessor.Document.Pages.Count; i > 0; i--)
    if (i % 2 != 0)


The following code snippets (auto-collected from DevExpress Examples) contain references to the Pages property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also