PDFium Component Docs

FindFirst 메서드

이 API 항목은 식별자, 시그니처, 코드 블록, PDF 용어를 원래 형태로 유지합니다.
컴포넌트: TPdfView  ·  유닛: PDFium
지정한 text 검색을 시작합니다. StartIndex는 0-based이며, -1은 page 끝을 뜻합니다. DirectionUp parameter는 이 검색의 방향을 결정합니다

구문

function FindFirst(const Text: WString; Options: TSearchOptions= []; StartIndex: Integer= 0; DirectionUp: Boolean= True): Integer;

반환값

첫 번째 match의 0-based character index를 반환합니다. text를 찾지 못하면 -1을 반환합니다

설명

현재 page에서 text search를 시작합니다. 이후 match를 따라가려면 FindNext 또는 FindPrevious를 쓰기 전에 이 method를 먼저 호출하세요. FindFirst를 호출할 때마다 internal search handle이 초기화됩니다

반복하지 않고 모든 occurrence를 화면에 표시하려면 대신 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;

참고 항목

TPdfView.FindNext, TPdfView.FindPrevious, TPdfView.Find, TPdfView.HighlightSearchText