AddTextMarkupFromSearchHits
Annotations and hotspot links
Descrição
Adds one text markup annotation per rectangle in Hits, turning any hit array returned by SearchText, SearchTextEach, SearchTextBatch or GetTextInAreaEx straight into markup annotations without a manual loop over AddTextMarkupAnnotation
For each hit, a rectangle whose Page is outside the document's page range or whose Right/Bottom does not exceed Left/Top is skipped. Every surviving rectangle temporarily selects the hit's page before adding the annotation; the page that was selected when the call started is always restored before returning, even for hits spanning several pages
Sintaxe
Delphi
Function TPDFlib.AddTextMarkupFromSearchHits(MarkupType: Integer; Const Hits: Array Of TPDFlibSearchHit): Integer;Parâmetros
| MarkupType | 1 = Realce, 2 = Sublinhado, 3 = Ondulado, 4 = Tachado |
|---|---|
| Hits | Search hits to turn into annotations, typically produced by SearchText, SearchTextEach, SearchTextBatch or GetTextInAreaEx |
Return values
The number of annotations actually created. Hits with an out-of-range page or a degenerate rectangle are skipped and do not count. Returns 0 without changing the current page selection when MarkupType is outside 1–4, no document is selected, or Hits is empty
Remarks
Use HighlightTextSearchHits instead when the hits to mark up are the ones already retained by an active BeginTextSearch session. Set SearchContextChars before searching to also capture surrounding text on each hit for inspection or logging before marking it up
See also
AddTextMarkupAnnotation, HighlightTextSearchHits, SearchText, SearchTextEach, SearchTextBatch, TPDFlibSearchHit