Table of Contents

Method AddSource

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

AddSource(byte[], string?)

Adds a document as a source and returns its index.

public int AddSource(byte[] bytes, string? password = null)

Parameters

bytes byte[]

The PDF's bytes.

password string

The user or owner password, when the document is encrypted.

Returns

int

The source's index, for use with the append methods.

Exceptions

ArgumentNullException

bytes is null.

InvalidDocumentException

The bytes are not a usable PDF.

ResourceLimitExceededException

The sources exceed the input budget.

AddSource(Stream, string?)

Adds a document as a source and returns its index.

public int AddSource(Stream stream, string? password = null)

Parameters

stream Stream

A readable stream positioned at the start of the PDF.

password string

The user or owner password, when the document is encrypted.

Returns

int

The source's index, for use with the append methods.

Exceptions

ArgumentNullException

stream is null.

InvalidDocumentException

The stream is not a usable PDF.

AddSource(string, string?)

Adds a document as a source and returns its index.

public int AddSource(string path, string? password = null)

Parameters

path string

The path of the PDF to read.

password string

The user or owner password, when the document is encrypted.

Returns

int

The source's index, for use with the append methods.

Exceptions

ArgumentNullException

path is null.

InvalidDocumentException

The file is not a usable PDF.