THPDFViewerHighlight Record
Stores one page-anchored highlight rectangle and its color 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 the highlight is anchored to |
PageRect | Rectangle in PDF user space; AddHighlightRegion normalizes it and clamps it to the visible page box (the CropBox clipped to the MediaBox) before storing |
Color | TColor used to draw the highlight, clYellow by default |
Usage notes
- Create highlights with
THPDFViewerModel.AddHighlightRegion, read them back withTryGetHighlightRegion, and remove them withRemoveHighlightRegionorClearHighlightRegions - Rectangles that collapse after clamping to the visible page box are rejected and
AddHighlightRegionreturns -1 - Every change fires the model's
OnHighlightChangeevent so hosts can repaint