THPDFTextMatch Record
Describes 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 in place and the public search API fills in the real page index |
GlyphStart | Inclusive index, within the page glyph array, of the match's first glyph |
GlyphEnd | Inclusive index of the match's last glyph |
TokenIndex | Source operand token of the first glyph, letting a caller rewrite its bytes |
ItemIndex | TJ array item that holds the first glyph where the operand is an array |
X | User-space X coordinate of the first glyph origin |
Y | User-space Y coordinate of the first glyph origin |
Width | User-space advance measured from the first glyph origin to the last glyph end |
Text | The matched text, exactly as it appears in the glyph sequence |
Usage notes
- Produced by
SearchLoadedPageText,SearchLoadedDocumentTextand the whole-word search variant GetLoadedSearchHitRectcollapses the glyph range into a single rectangle so a UI can draw one highlight boxTokenIndexandItemIndexlet text replace rewrite precisely the operand that produced the hit