function FindFirst(const Text: WString; Options: TSearchOptions= []; StartIndex: Integer= 0; DirectionUp: Boolean= True): Integer;
-1在目前頁面上起始文字搜尋。使用 FindNext 或 FindPrevious 迭代後續符合項目之前,請先呼叫此方法。每次呼叫 FindFirst 都會重設內部搜尋控制代碼
若要在不迭代的情況下以視覺方式醒目提示所有出現位置,請改用 HighlightSearchText
var Pos: Integer;
begin
Pos := PdfView.FindFirst('invoice', [soMatchCase]);
while Pos >= 0 do
begin
Memo1.Lines.Add('Found at index: ' + IntToStr(Pos));
Pos := PdfView.FindNext;
end;
end;