Method ImportPages

Namespace
SoftZenPdf
Assembly
SoftZenPdf.dll

ImportPages(PdfReader)

Appends copies of every page of source.

public IReadOnlyList<PdfPage> ImportPages(PdfReader source)

Parameters

source PdfReader

The document to copy pages from.

Returns

IReadOnlyList<PdfPage>

The appended pages, which can be drawn on, rotated, moved and linked to like any other page.

Exceptions

UnauthorizedAccessException

The source is encrypted, opened without owner rights, and does not permit copying and assembly.

ImportPages(PdfReader, IEnumerable<int>)

Appends copies of selected pages of source, in the order given.

public IReadOnlyList<PdfPage> ImportPages(PdfReader source, IEnumerable<int> pageIndices)

Parameters

source PdfReader

The document to copy pages from.

pageIndices IEnumerable<int>

Zero-based page indices; a page may appear more than once.

Returns

IReadOnlyList<PdfPage>

The appended pages.

Remarks

Objects shared between imported pages (fonts, images) are copied once per source reader. Content drawn on an imported page is added on top of its original content.

Exceptions

ArgumentOutOfRangeException

An index is outside the source's pages.

UnauthorizedAccessException

The source is encrypted, opened without owner rights, and does not permit copying and assembly.