• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class PageCollection

The ordered collection of pages in a Document. Backed by the document's internal page tree.

Inheritance
object
PageCollection
Implements
IEnumerable<Page>
IEnumerable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Pdf
Assembly: DRIT.Pdf.dll
Syntax
public sealed class PageCollection : IEnumerable<Page>, IEnumerable

Properties

Count

Gets the number of pages in the document.

Declaration
public int Count { get; }
Property Value
Type Description
int

this[int]

Gets the page at the specified zero-based index.

Declaration
public Page this[int index] { get; }
Parameters
Type Name Description
int index

The zero-based page index.

Property Value
Type Description
Page
Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when index is outside the collection.

Kids

Page-tree children operations for the root page-tree node.

Declaration
public PageTreeKidCollection Kids { get; }
Property Value
Type Description
PageTreeKidCollection

Rotate

Root page-tree rotation inherited by pages created through Kids operations.

Declaration
public int Rotate { get; set; }
Property Value
Type Description
int

Methods

Add()

Add a new blank A4 page to the end of the document.

Declaration
public Page Add()
Returns
Type Description
Page

Add(PdfSize)

Add a new blank page with a standard size.

Declaration
public Page Add(PdfSize size)
Parameters
Type Name Description
PdfSize size
Returns
Type Description
Page

Add(double, double)

Add a new blank page with the given dimensions (in points).

Declaration
public Page Add(double width, double height)
Parameters
Type Name Description
double width
double height
Returns
Type Description
Page

AddClone(Page)

Deep-copy a page from another document and append it to this collection. All resources (fonts, images, XObjects, ExtGStates, etc.) are recursively copied and renumbered into this document's object namespace. The source page's Content must have been finalized (i.e. the document must have been saved at least once, or the source page content stream must already be attached).

Declaration
public Page AddClone(Page sourcePage)
Parameters
Type Name Description
Page sourcePage
Returns
Type Description
Page

AddClone(PageCollection)

Appends deep clones of all pages from sourcePages.

Declaration
public void AddClone(PageCollection sourcePages)
Parameters
Type Name Description
PageCollection sourcePages

GetEnumerator()

Returns an enumerator that iterates through the pages in the collection.

Declaration
public IEnumerator<Page> GetEnumerator()
Returns
Type Description
IEnumerator<Page>

InsertClone(int, PageCollection)

Inserts deep clones of all pages from sourcePages starting at index.

Declaration
public void InsertClone(int index, PageCollection sourcePages)
Parameters
Type Name Description
int index
PageCollection sourcePages

RemoveAt(int)

Removes the page at index.

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

SetMediaBox(double, double, double, double)

Sets the root page-tree media box inherited by pages created through Kids operations.

Declaration
public void SetMediaBox(double left, double bottom, double right, double top)
Parameters
Type Name Description
double left
double bottom
double right
double top

Implements

IEnumerable<T>
IEnumerable
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX