searchPdfText

fun searchPdfText(textRuns: List<<Error class: unknown class>>, query: String): List<PdfSearchHighlight>

Scans every PdfTextRun for case-insensitive occurrences of query and returns a sorted list of PdfSearchHighlights in document order (page → top-to-bottom → left-to-right).

Returns an empty list when query is blank — callers don't need to pre-trim their input.

Multiple non-overlapping matches inside the same run are all captured (e.g. query = "the" finds both occurrences in "the quick brown fox jumps over the lazy dog").