PDFium Component Docs

Rectangle Właściwość

Ten wpis API zachowuje identyfikatory, sygnatury, bloki kodu i terminy PDF w oryginalnej postaci.
Komponent: TPdf  ·  Moduł: PDFium
Returns one text bounding rectangle from the current page text layout.

Składnia

property Rectangle[Index: Integer]: TPdfRectangle; // read only

Opis

Rectangle[Index] returns one bounding rectangle generated by RectangleCount for text on the current page.

Call RectangleCount(StartIndex, Count) first to determine how many rectangles PDFium exposes for the requested text range, then read Rectangle[0] through Rectangle[Count - 1].

The returned TPdfRectangle uses PDF page coordinates. Use PageToDevice when you need viewer or bitmap coordinates.

Uwagi

Przykład

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;

Zobacz też

RectangleCount, Text, TextInRectangle, PageToDevice