Diagnostic Class

Definition

A record of one deviation from the specification found while reading a file, and what was done about it.

public sealed class Diagnostic

Remarks

In lenient mode a reader repairs what it can and records a diagnostic on the document; in strict mode the first Warning or Error is thrown as a DiagnosticException. A well-formed file produces no warnings and no errors: one means a "shall" of ISO 32000-2 was violated or the reader changed what it read, never that a "should" was not followed. Information notes a valid feature the library preserves without supporting it, and is never thrown.

Codes are stable PascalCase identifiers, such as StreamLengthInvalid or PageTreeCountMismatch; match on Code, Offset and ObjectReference, never on Message. A document records each repair once: the same code at the same offset in the same object is not recorded twice, however often it is met.

ISO 32000-2 §7.5 describes the file structure a reader repairs (cross-reference table, trailer, startxref) but does not specify repair; the codes for it are StartxrefMissing, StartxrefInvalid, TrailerMissing, RootMissing, XrefEntryOffsetInvalid, MissingEndobj and StreamLengthInvalid, among others.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Constructors (1)

Properties (5)

Methods (1)