Table of Contents

Class PageCollection

Namespace
EvoPdf
Assembly
evohtmltopdf.dll

This class represents a collection of pages of in a PDF document

[ClassInterface(ClassInterfaceType.AutoDual)]
public class PageCollection : IEnumerable
Inheritance
PageCollection
Implements
Inherited Members

Properties

Count

The number of pages in collection.

public int Count { get; }

Property Value

int

Document

The parent document of this collection

public Document Document { get; }

Property Value

Document

this[int]

Gets or sets the page at the specified zero based index in the pages collection.

public PdfPage this[int pageIndex] { get; set; }

Parameters

pageIndex int

The zero based page index in the collection.

Property Value

PdfPage

The PDF page at the specified index

Methods

Add(PdfPage)

Adds the specified page to the document pages collection. The page to be added is allowed to be from another document. The source document of the page to be added must remain opened until the current document is saved.

public int Add(PdfPage pdfPage)

Parameters

pdfPage PdfPage

The page to be added to the collection.

Returns

int

The index of the page in collection. If the page already exists, this method returns the index of the existing page

AddNewPage()

Creates a new PDF page and adds it to the collection. If there is a previous page in the collection, the orientation and size are inherited from the that page otherwise a first page with the default A4 size and Portrait orientation is created. The page margins are inherited from the default document margins.

public PdfPage AddNewPage()

Returns

PdfPage

The newly created PDF page.

AddNewPage(Margins)

Creates a new PDF page and adds it to the collection. If there is a previous page in the collection, the orientation and size are inherited from the that page otherwise a first page with the default A4 size and Portrait orientation is created.

public PdfPage AddNewPage(Margins pageMargins)

Parameters

pageMargins Margins

The PDF page margins.

Returns

PdfPage

The newly created PDF page.

AddNewPage(PdfPageSize, Margins)

Creates a new PDF page and adds it to the collection. If there is a previous page in the collection, the page orientation is inherited from the that page otherwise a first page with the specified size and Portrait orientation is created.

public PdfPage AddNewPage(PdfPageSize pageSize, Margins pageMargins)

Parameters

pageSize PdfPageSize

The page size in points.

pageMargins Margins

The page mergins in points.

Returns

PdfPage

The newly created PDF page.

AddNewPage(PdfPageSize, Margins, PdfPageOrientation)

Creates a new PDF page with the specified size, margins and orientation and adds it to the collection.

public PdfPage AddNewPage(PdfPageSize pageSize, Margins pageMargins, PdfPageOrientation pageOrientation)

Parameters

pageSize PdfPageSize

The PDF page size in points.

pageMargins Margins

The PDF page margins in points.

pageOrientation PdfPageOrientation

The PDF page orientation.

Returns

PdfPage

The newly created PDF page.

AddRange(PdfPage[])

Adds the specified array of pages to the PDF document pages. The page to be added are allowed to be from another document. The source document of the pages to be added must remain opened until the current document is saved.

public void AddRange(PdfPage[] pages)

Parameters

pages PdfPage[]

The PDF pages to be added.

Contains(PdfPage)

Indicates if the collection contains specified page.

public bool Contains(PdfPage pdfPage)

Parameters

pdfPage PdfPage

The PDF page to search.

Returns

bool

True if the collection contains specified page.

GetEnumerator()

Gets the collection enumerator.

public IEnumerator GetEnumerator()

Returns

IEnumerator

The collection enumerator.

IndexOf(PdfPage)

Returns the index of specified page in collection.

public int IndexOf(PdfPage pdfPage)

Parameters

pdfPage PdfPage

PDF page to search.

Returns

int

The index of the page in collection.

Insert(int, PdfPage)

Inserts the specified page into the document pages collection at the specified index. The page to be added is allowed to be from another document. The source document of the page to be inserted must remain opened until the current document is saved.

public void Insert(int pageIndex, PdfPage pdfPage)

Parameters

pageIndex int

The index where the page will be inserted.

pdfPage PdfPage

The PDF page to be inserted.

InsertNewPage(int, PdfPageSize, Margins, PdfPageOrientation)

Creates a new PDF page with the specified size, margins and orientation and inserts it into the collection at the specified index

public PdfPage InsertNewPage(int index, PdfPageSize pageSize, Margins pageMargins, PdfPageOrientation pageOrientation)

Parameters

index int

The index where to insert the new page.

pageSize PdfPageSize

The PDF page size in points.

pageMargins Margins

The PDF page margins in points.

pageOrientation PdfPageOrientation

The PDF page orientation.

Returns

PdfPage

The newly created PDF page.

Remove(PdfPage)

Removes the specified PDF page from the pages collection.

public void Remove(PdfPage pdfPage)

Parameters

pdfPage PdfPage

The PDF page to be removed.

Remove(int)

Removes the PDF page at the specified index in collection.

public void Remove(int pageIndex)

Parameters

pageIndex int

The zero based index of the PDF page to be removed.