THPDFViewerHighlight Record
Stores a single page-anchored highlight rectangle and its colour in the viewer model
Declaration
THPDFViewerHighlight= record
PageIndex: Integer;
PageRect: THPDFRectangle;
Color: TColor;
end;
Unit
HPDFViewerModel
Fields
| Field | Purpose |
|---|---|
PageIndex | Zero-based index of the page to which the highlight is anchored |
PageRect | Rectangle in PDF user space; AddHighlightRegion normalises it and clamps it to the page MediaBox before storing it |
Color | TColor used when drawing the highlight; clYellow by default |
Usage notes
- Create highlights with
THPDFViewerModel.AddHighlightRegion, read them back withTryGetHighlightRegionand remove them withRemoveHighlightRegionorClearHighlightRegions - Rectangles that collapse once clamped to the MediaBox are rejected, and
AddHighlightRegionreturns -1 - Each change fires the model's
OnHighlightChangeevent so that hosts can repaint