KiteTextSelection

data class KiteTextSelection(val pageIndex: Int, val start: Int, val end: Int, val text: String, val quads: List<KiteRectangle>, val location: KiteLocation? = null)(source)

A finalized or in-progress text selection on one page (cross-page selection is out of scope). start/end are INCLUSIVE flattened char indices into the page's io.github.yuroyami.kitepdf.core.KiteStructuredText reading order; text is the range as a reader copies it (io.github.yuroyami.kitepdf.core.KiteStructuredText.copyText): \n\n between blocks, and a wrapped paragraph of a book as one line; quads are display-space, one per line touched.

Constructors

Link copied to clipboard
constructor(pageIndex: Int, start: Int, end: Int, text: String, quads: List<KiteRectangle>, location: KiteLocation? = null)
constructor(pageIndex: Int, start: Int, end: Int, text: String, quads: List<KiteRectangle>)

Legacy constructor for callers that do not yet carry a location.

Properties

Link copied to clipboard
val end: Int
Link copied to clipboard

Exact page in this layout. A reflow changes both this coordinate and the quads.

Link copied to clipboard

The viewer slot when this selection was produced. Persist location instead.

Link copied to clipboard
Link copied to clipboard
val start: Int
Link copied to clipboard

Functions

Link copied to clipboard
fun copy(pageIndex: Int = this.pageIndex, start: Int = this.start, end: Int = this.end, text: String = this.text, quads: List<KiteRectangle> = this.quads): KiteTextSelection

Keeps the original copy signature and preserves this selection's location.