SearchContextChars
文字與擷取
描述
SearchContextChars 控制周邊區塊文字要擷取多少字元,適用於 SearchText、SearchTextEach、SearchTextBatch 以及有狀態的 BeginTextSearch / NextTextSearchHit 配對
為 0(預設)或負值時,每個傳回的 TPDFlibSearchHit 上的 ContextBefore 與 ContextAfter 欄位保持為空
為正值時,每個命中的 ContextBefore 保存 MatchText 內緊鄰匹配之前的至多 SearchContextChars 個字元,ContextAfter 則保存其後的字元
語法
Delphi
Property TPDFlib.SearchContextChars: Integer Read FSearchContextChars Write FSearchContextChars;備註
呼叫搜尋方法前先設定此屬性;建立每個命中時各讀取一次。之後再改不會影響先前呼叫已傳回的命中
另見
TPDFlibSearchHit, SearchText, SearchTextEach, SearchTextBatch, BeginTextSearch