PdfSearchHighlight

data class PdfSearchHighlight(val pageIndex: Int, val xPoints: Float, val yPoints: Float, val widthPoints: Float, val heightPoints: Float)

One matched substring inside a PDF page, expressed in the same coordinate system as PdfTextRun (PDF points, top-left origin).

The matcher uses a linear-width approximation to slice the parent text run — i.e. the matched substring's bounding box is a proportional fraction of the run's full bounding box. That isn't pixel-perfect for variable-width fonts (an i is narrower than an M) but it's fine for a translucent highlight rectangle, where the user only needs to see "the word is around here". The active match gets a tighter colour treatment to draw the eye anyway.

Constructors

Link copied to clipboard
constructor(pageIndex: Int, xPoints: Float, yPoints: Float, widthPoints: Float, heightPoints: Float)

Properties

Link copied to clipboard

height of the match's bounding box — inherited from the parent run.

Link copied to clipboard

zero-based page the match belongs to.

Link copied to clipboard

width of the match's bounding box.

Link copied to clipboard

left edge of the match's bounding box.

Link copied to clipboard

top edge of the match's bounding box.