THPDFTextMatch Record
Locates one needle occurrence found by loaded-page text search with its glyph range, source operand, and user-space geometry
Declaration
THPDFTextMatch= record
PageIndex: Integer;
GlyphStart: Integer;
GlyphEnd: Integer;
TokenIndex: Integer;
ItemIndex: Integer;
X, Y: Double;
Width: Double;
Text: UnicodeString;
end;
Unit
HPDFContentStream
Fields
| Field | Purpose |
|---|---|
PageIndex | Page holding the match; the glyph matcher leaves -1 and the public search API fills the real page index |
GlyphStart | Inclusive index of the first glyph of the match in the page glyph array |
GlyphEnd | Inclusive index of the last glyph of the match |
TokenIndex | Source operand token of the first glyph, so a caller can rewrite its bytes |
ItemIndex | TJ array item holding the first glyph when the operand is an array |
X | User-space X of the first glyph origin |
Y | User-space Y of the first glyph origin |
Width | User-space advance from the first glyph origin to the last glyph end |
Text | Matched text exactly as it appears in the glyph sequence |
Usage notes
- Produced by
SearchLoadedPageText,SearchLoadedDocumentText, and the whole-word search variant GetLoadedSearchHitRectcollapses the glyph range into one rectangle so a UI can draw a single highlight boxTokenIndexandItemIndexlet text replace rewrite exactly the operand that produced the hit