Skip to main content

Class PdfReaderOptions

Namespace: AdCodicem.Pdf.Documents
Assembly: AdCodicem.Pdf.dll

Controls how a document is opened.

public sealed record PdfReaderOptions : IEquatable<PdfReaderOptions>

Inheritance​

object ← PdfReaderOptions

Implements​

IEquatable<PdfReaderOptions>

Inherited Members​

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Properties​

Default​

The options used when none are supplied.

public static PdfReaderOptions Default { get; }

Property Value​

PdfReaderOptions

DiagnosticCapacity​

Gets the largest number of diagnostic entries kept for one document.

public int DiagnosticCapacity { get; init; }

Property Value​

int

Limits​

Gets the reader's guards: bounds a valid document may exceed, set against hostile input. A stream read from the document decodes under them too, however long after opening.

public PdfReaderLimits Limits { get; init; }

Property Value​

PdfReaderLimits

ObjectCacheCapacity​

Gets the number of parsed objects kept in memory. Objects beyond this are re-read from the file when they are needed again, which is the trade the reader makes to keep memory predictable.

public int ObjectCacheCapacity { get; init; }

Property Value​

int

ThrowOnEncrypted​

Gets a value indicating whether opening an encrypted document fails. Decryption arrives with the security milestone; until then, failing loudly beats returning unreadable content.

public bool ThrowOnEncrypted { get; init; }

Property Value​

bool

ThrowOnLimit​

Gets a value indicating whether reaching one of the PdfReaderOptions.Limits throws a PdfLimitExceededException rather than keeping what fits and reporting it.

public bool ThrowOnLimit { get; init; }

Property Value​

bool

Remarks​

Reading is lazy, so the exception can come from any operation that reads: PdfDocument.Open(string, PdfReaderOptions?), resolving an object, decoding a stream.