Skip to main content

Struct PdfDiagnostic

Namespace: AdCodicem.Pdf.Diagnostics
Assembly: AdCodicem.Pdf.dll

A single observation made while reading, writing or transforming a document.

public readonly record struct PdfDiagnostic : IEquatable<PdfDiagnostic>

Implements​

IEquatable<PdfDiagnostic>

Inherited Members​

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

Constructors​

PdfDiagnostic(PdfDiagnosticSeverity, string, string, long)​

A single observation made while reading, writing or transforming a document.

public PdfDiagnostic(PdfDiagnosticSeverity Severity, string Code, string Message, long Position = -1)

Parameters​

Severity PdfDiagnosticSeverity

How much the entry should worry the caller.

Code string

Stable machine-readable code; part of the public contract.

Message string

Human-readable explanation, in English.

Position long

Byte offset in the file the observation relates to, or -1 when it relates to no position. An offset equal to the file's length designates its end, where the file stops short of what it should hold. An offset a section's trailer or an object's entry names outside the file — past its end, before its start, or past what a long holds once the header's offset is added — is no position: the entry is placed at the section that named it, or has none, and the offset is in the message. The object-stream.* entries, and a fault met inside an object an object stream holds, are placed where the stream's data starts in the file, the byte of decoded data in the message.

Properties​

Code​

Stable machine-readable code; part of the public contract.

public string Code { get; init; }

Property Value​

string

Message​

Human-readable explanation, in English.

public string Message { get; init; }

Property Value​

string

Position​

Byte offset in the file the observation relates to, or -1 when it relates to no position. An offset equal to the file's length designates its end, where the file stops short of what it should hold. An offset a section's trailer or an object's entry names outside the file — past its end, before its start, or past what a long holds once the header's offset is added — is no position: the entry is placed at the section that named it, or has none, and the offset is in the message. The object-stream.* entries, and a fault met inside an object an object stream holds, are placed where the stream's data starts in the file, the byte of decoded data in the message.

public long Position { get; init; }

Property Value​

long

Severity​

How much the entry should worry the caller.

public PdfDiagnosticSeverity Severity { get; init; }

Property Value​

PdfDiagnosticSeverity

Methods​

ToString()​

Returns the fully qualified type name of this instance.

public override string ToString()

Returns​

string

The fully qualified type name.