PdfHighlight

data class PdfHighlight(val hit: KiteSearchHit, val color: Color? = null, val edgeMarker: Boolean = false, val edgeMarkerColor: Color? = null, val edgeMarkerSide: PdfMarkerSide = PdfMarkerSide.End)

One entry of PdfViewState.highlights: where to paint (hit) plus how to paint it.

KiteSearchHit stays a pure text-search result, with no idea colours exist; this wraps one with the viewer's paint choices. Build the hit yourself from quads you already hold, or take it straight out of PdfDocument.search / KiteStructuredText.search.

Parameters

hit

the page index and the display-space quads to cover.

color

fill for those quads. Null (the default) paints PdfViewColors.searchHighlight, exactly what PdfViewState.searchHighlights does, so wrapping a plain hit changes nothing on screen.

edgeMarker

also paint a small rounded marker in one page margin, level with this highlight. It tells a reader a note lives on this page without them having to find the highlighted words. Every dimension is a fraction of the rendered page width, so it keeps its proportions in a thumbnail and at deep zoom alike, and its inner edge is clamped past the highlighted quads so it never paints over the words. On a page whose text reaches into that margin, leaving no room, nothing is drawn.

edgeMarkerColor

fill for that marker. Null (the default) falls back to color, and then to PdfViewColors.searchHighlight. A marker usually wants a stronger, opaque colour than the translucent fill next to it.

edgeMarkerSide

which margin carries the marker. PdfMarkerSide.End is the pre-0.5.1 behaviour and stays the default.

Constructors

Link copied to clipboard
constructor(hit: KiteSearchHit, color: Color? = null, edgeMarker: Boolean = false, edgeMarkerColor: Color? = null, edgeMarkerSide: PdfMarkerSide = PdfMarkerSide.End)

Properties

Link copied to clipboard
val color: Color?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard