Table of Contents

Method Split

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

Split(byte[], IReadOnlyList<PageRange>, IReadOnlyList<Stream>, PdfAssemblyOptions?)

Writes one document per selection, all taken from one source.

public static IReadOnlyList<PdfAssemblyResult> Split(byte[] source, IReadOnlyList<PageRange> parts, IReadOnlyList<Stream> outputs, PdfAssemblyOptions? options = null)

Parameters

source byte[]

The source PDF's bytes.

parts IReadOnlyList<PageRange>

The selections, one per output document.

outputs IReadOnlyList<Stream>

A writable stream per selection, in the same order.

options PdfAssemblyOptions

The assembly settings, or null for the defaults.

Returns

IReadOnlyList<PdfAssemblyResult>

One result per output, in the same order.

Remarks

Splitting into single pages is parts of Single(int) — the method takes selections rather than assuming one page each so that splitting a report into its chapters does not need a different method from splitting it into its pages.

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

The counts of parts and outputs differ, or there are no parts.

Split(string, IReadOnlyList<PageRange>, IReadOnlyList<string>, PdfAssemblyOptions?)

Writes one document per selection, all taken from one source.

public static IReadOnlyList<PdfAssemblyResult> Split(string sourcePath, IReadOnlyList<PageRange> parts, IReadOnlyList<string> outputPaths, PdfAssemblyOptions? options = null)

Parameters

sourcePath string

The source PDF's path.

parts IReadOnlyList<PageRange>

The selections, one per output document.

outputPaths IReadOnlyList<string>

A path per selection, in the same order.

options PdfAssemblyOptions

The assembly settings, or null for the defaults.

Returns

IReadOnlyList<PdfAssemblyResult>

One result per output, in the same order.

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

The counts of parts and outputs differ, or there are no parts.