Table of Contents

Method Delete

Namespace
DocWright.Formats.Pdf
Assembly
DocWright.Formats.Pdf.dll

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

source byte[]

The source PDF's bytes.

pages PageRange

The 1-based pages to remove, for example PageRange.Parse("3,7").

output Stream

A writable stream for the result.

options PdfAssemblyOptions

The assembly settings, or null for the defaults.

Returns

PdfAssemblyResult

What was produced, and everything that could not be carried.

Exceptions

ArgumentNullException

source or output is 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

sourcePath string

The source PDF's path.

pages PageRange

The 1-based pages to remove.

outputPath string

The path to write.

options PdfAssemblyOptions

The 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.