property Rectangle[Index: Integer]: TPdfRectangle; // read only
Rectangle[Index] restituisce un rettangolo di bounding generato da RectangleCount per il testo nella pagina corrente
Chiama prima RectangleCount(StartIndex, Count) per scoprire quanti rettangoli PDFium espone per l'intervallo di testo richiesto, poi leggi Rectangle[0] fino a Rectangle[Count - 1]
Il TPdfRectangle restituito usa coordinate pagina PDF. Usa PageToDevice quando ti servono coordinate della vista o del bitmap
Index è a base zero e deve essere inferiore all'ultimo conteggio di rettangoli
var
I, Count: Integer;
R: TPdfRectangle;
begin
Count := Pdf1.RectangleCount(0, Pdf1.CharacterCount);
for I := 0 to Count - 1 do
begin
R := Pdf1.Rectangle[I];
Memo1.Lines.Add(Format('%.2f, %.2f, %.2f, %.2f', [R.Left, R.Top, R.Right, R.Bottom]));
end;
end;