Method Delete
Delete(byte[], PageRange, Stream, PdfAssemblyOptions?)
Writes a copy of a document with the selected pages removed.
public static PdfAssemblyResult Delete(byte[] source, PageRange pages, Stream output, PdfAssemblyOptions? options = null)
Parameters
sourcebyte[]The source PDF's bytes.
pagesPageRangeThe 1-based pages to remove, for example
PageRange.Parse("3,7").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
Every page was selected for removal.
Delete(string, PageRange, string, PdfAssemblyOptions?)
Writes a copy of a document with the selected pages removed.
public static PdfAssemblyResult Delete(string sourcePath, PageRange pages, string outputPath, PdfAssemblyOptions? options = null)
Parameters
sourcePathstringThe source PDF's path.
pagesPageRangeThe 1-based pages to remove.
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.