Method Extract
Extract(byte[], PageRange, Stream, PdfAssemblyOptions?)
Writes a document containing only the selected pages, in ascending order.
public static PdfAssemblyResult Extract(byte[] source, PageRange pages, Stream output, PdfAssemblyOptions? options = null)
Parameters
sourcebyte[]The source PDF's bytes.
pagesPageRangeThe 1-based pages to keep.
outputStreamA writable stream for the result.
optionsPdfAssemblyOptionsThe assembly settings, or null for the defaults.
Returns
- PdfAssemblyResult
What was produced, and everything that could not be carried.
Exceptions
- ArgumentNullException
sourceoroutputis null.- InvalidOperationException
The selection matched no page.
Extract(string, PageRange, string, PdfAssemblyOptions?)
Writes a document containing only the selected pages, in ascending order.
public static PdfAssemblyResult Extract(string sourcePath, PageRange pages, string outputPath, PdfAssemblyOptions? options = null)
Parameters
sourcePathstringThe source PDF's path.
pagesPageRangeThe 1-based pages to keep.
outputPathstringThe path to write.
optionsPdfAssemblyOptionsThe assembly settings, or null for the defaults.
Returns
- PdfAssemblyResult
What was produced, and everything that could not be carried.
Exceptions
- ArgumentNullException
A path is null.