Method AddSource
AddSource(byte[], string?)
Adds a document as a source and returns its index.
public int AddSource(byte[] bytes, string? password = null)
Parameters
bytesbyte[]The PDF's bytes.
passwordstringThe user or owner password, when the document is encrypted.
Returns
- int
The source's index, for use with the append methods.
Exceptions
- ArgumentNullException
bytesis 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
streamStreamA readable stream positioned at the start of the PDF.
passwordstringThe user or owner password, when the document is encrypted.
Returns
- int
The source's index, for use with the append methods.
Exceptions
- ArgumentNullException
streamis 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
pathstringThe path of the PDF to read.
passwordstringThe user or owner password, when the document is encrypted.
Returns
- int
The source's index, for use with the append methods.
Exceptions
- ArgumentNullException
pathis null.- InvalidDocumentException
The file is not a usable PDF.