THPDFLayoutDiagnostic Record
One structured layout event: what happened and why, the page and rectangle involved, line counts, element paths, and the optional source-code location of the element
Declaration
THPDFLayoutDiagnostic= record
Kind: THPDFLayoutDiagnosticKind;
PageIndex: Integer;
RelatedPageIndex: Integer;
X: Single;
Y: Single;
Width: Single;
Height: Single;
LineCount: Integer;
Reason: AnsiString;
ElementPath: AnsiString;
RelatedElementPath: AnsiString;
SourceFile: AnsiString;
SourceLine: Integer;
SourceColumn: Integer;
end;
Unit
HPDFDoc
Fields
| Field | Purpose |
|---|---|
Kind | THPDFLayoutDiagnosticKind event type, such as ldkAutomaticPageBreak or ldkKeepWithNext |
PageIndex | Zero-based page the event occurred on |
RelatedPageIndex | Paired page for cross-page events such as an element splitting onto the next page |
X / Y / Width / Height | Placement rectangle involved in the event, in the same terms as THPDFLayoutBounds |
LineCount | Number of text lines involved, for example the lines laid out before an automatic break |
Reason | Human-readable explanation of why the event was recorded |
ElementPath | Path of the layout element the event belongs to |
RelatedElementPath | Path of the paired element for overlap and split events |
SourceFile / SourceLine / SourceColumn | Declaration site captured through SetDiagnosticSource when source-location capture is enabled |
Usage notes
- Records are produced by the layout engine while diagnostics are enabled and delivered through
THotPDF.GetLayoutDiagnostics,THotPDF.GetLayoutDiagnostic, or theOnLayoutDiagnosticevent - Use
KindplusElementPathto filter, andReasonfor direct display in logs or issue lists - The rectangle fields feed
THotPDF.DrawLayoutDiagnosticOverlayso events can be visualized directly on the rendered page