Method Extract

Namespace
SoftZenPdf
Assembly
SoftZenPdf.dll

Extract(PdfReader, IEnumerable<int>)

Creates a new document from selected pages of source, in the order given.

public static PdfDocument Extract(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

PdfDocument

A new, unsaved document.

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.