PDFium Component Docs

מאפיין Rectangle

Component: TPdf  ·  Unit: PDFium
מחזיר מלבן גבול אחד של טקסט מתוך פריסת הטקסט של הדף הנוכחי

Syntax

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

Description

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.

Remarks

Example

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;

See Also

RectangleCount, Text, TextInRectangle, PageToDevice