AddTextMarkupFromSearchHits

Σχολιάσεις και σύνδεσμοι hotspot

Περιγραφή

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

Σύνταξη

Delphi

Function TPDFlib.AddTextMarkupFromSearchHits(MarkupType: Integer; Const Hits: Array Of TPDFlibSearchHit): Integer;

Παράμετροι

MarkupType1 = Highlight, 2 = Underline, 3 = Squiggly, 4 = StrikeOut
HitsSearch hits to turn into annotations, typically produced by SearchText, SearchTextEach, SearchTextBatch or GetTextInAreaEx

Τιμές επιστροφής

Ο αριθμός των σχολίων που δημιουργήθηκαν πραγματικά. Τα hits με σελίδα εκτός εύρους ή εκφυλισμένο ορθογώνιο παραλείπονται και δεν προσμετρώνται. Επιστρέφει 0 χωρίς να αλλάξει η τρέχουσα επιλογή σελίδας όταν το MarkupType είναι εκτός του 1–4, δεν έχει επιλεγεί έγγραφο ή το Hits είναι κενό

Παρατηρήσεις

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

Δείτε επίσης

AddTextMarkupAnnotation, HighlightTextSearchHits, SearchText, SearchTextEach, SearchTextBatch, TPDFlibSearchHit