Table of Contents

Class PdfPages

Namespace
PdfSharp.Pdf
Assembly
PdfSharp.dll

Represents the pages of the document.

public sealed class PdfPages : PdfDictionary, ICloneable, IEnumerable<KeyValuePair<string, PdfItem?>>, IEnumerable<PdfPage>, IEnumerable
Inheritance
PdfPages
Implements
Inherited Members

Properties

Count

Gets the number of pages.

public int Count { get; }

Property Value

int

this[int]

Gets the page with the specified index.

public PdfPage this[int index] { get; }

Parameters

index int

Property Value

PdfPage

PagesArray

Gets a PdfArray containing all pages of this document. The array must not be modified.

public PdfArray PagesArray { get; }

Property Value

PdfArray

Methods

Add()

Creates a new PdfPage, adds it to the end of this document, and returns it.

public PdfPage Add()

Returns

PdfPage

Add(PdfPage)

Adds the specified PdfPage to the end of this document and maybe returns a new PdfPage object. The value returned is a new object if the added page comes from a foreign document.

public PdfPage Add(PdfPage page)

Parameters

page PdfPage

Returns

PdfPage

GetEnumerator()

Gets the enumerator.

public IEnumerator<PdfPage> GetEnumerator()

Returns

IEnumerator<PdfPage>

Insert(int)

Creates a new PdfPage, inserts it at the specified position into this document, and returns it.

public PdfPage Insert(int index)

Parameters

index int

Returns

PdfPage

Insert(int, PdfPage)

Inserts the specified PdfPage at the specified position to this document and maybe returns a new PdfPage object. The value returned is a new object if the inserted page comes from a foreign document.

public PdfPage Insert(int index, PdfPage page)

Parameters

index int
page PdfPage

Returns

PdfPage

InsertRange(int, PdfDocument)

Inserts all pages of the specified document into this document.

public void InsertRange(int index, PdfDocument document)

Parameters

index int

The index in this document where to insert the page .

document PdfDocument

The document to be inserted.

InsertRange(int, PdfDocument, int)

Inserts all pages of the specified document into this document.

public void InsertRange(int index, PdfDocument document, int startIndex)

Parameters

index int

The index in this document where to insert the page .

document PdfDocument

The document to be inserted.

startIndex int

The index of the first page to be inserted.

InsertRange(int, PdfDocument, int, int)

Inserts pages of the specified document into this document.

public void InsertRange(int index, PdfDocument document, int startIndex, int pageCount)

Parameters

index int

The index in this document where to insert the page .

document PdfDocument

The document to be inserted.

startIndex int

The index of the first page to be inserted.

pageCount int

The number of pages to be inserted.

MovePage(int, int)

Moves a page within the page sequence.

public void MovePage(int oldIndex, int newIndex)

Parameters

oldIndex int

The page index before this operation.

newIndex int

The page index after this operation.

Remove(PdfPage)

Removes the specified page from the document.

public void Remove(PdfPage page)

Parameters

page PdfPage

RemoveAt(int)

Removes the specified page from the document.

public void RemoveAt(int index)

Parameters

index int