Table of Contents

Property MaxPdfNestingDepth

Namespace
DocWright.Core
Assembly
DocWright.Core.dll

MaxPdfNestingDepth

Gets or sets how deeply PDF import may nest a construct that can contain itself — a form XObject, a tiling pattern, a Type 3 glyph procedure, or a parsed object's arrays and dictionaries.

Unlike its neighbours this one has no unlimited setting: null, and any value above the reader's own absolute ceiling, both resolve to that ceiling. The failure this guards is StackOverflowException, which no catch contains, so a caller who could lift the ceiling would be escaping the typed exception surface rather than widening it. Setting it therefore tightens the bound and never removes it.

On by default (DefaultMaxPdfNestingDepth), and for the same reason as MaxKeyDerivationSpinCount: the worst case is not bounded by input size. A two-hundred-byte PDF whose form XObject draws itself recurses forever, so there is no size at which the input is safe. Thirty-two levels is far past anything a real generator emits — Word, LibreOffice and Illustrator all stay in single digits.

public int? MaxPdfNestingDepth { get; set; }

Property Value

int?

Exceptions

ArgumentOutOfRangeException

The value is not positive.