PDFium Component Docs

FindFirst Método

Componente: TPdfView  ·  Unidad: PDFium
Inicia una búsqueda del texto indicado. StartIndex es base 0 y -1 significa el final de la página. El parámetro DirectionUp determina la dirección de la búsqueda

Syntax

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

Return Value

El índice de caracteres basado en 0 de la primera coincidencia, o -1 si el texto no se encuentra

Description

Initiates a text search on the current page. Call this method before using FindNext or FindPrevious to iterate through subsequent matches. Each call to FindFirst resets the internal search handle.

To highlight all occurrences visually without iterating, use HighlightSearchText instead.

Example

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;

See Also

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