PDFiumVCL 文档

Rectangle method

此 API 条目保留标识符、签名、代码块和 PDF 术语的原始形式。
Component: TPdf  ·  Unit: PDFium
Adds a rectangle page object in one call (no need for MoveTo/LineTo).

Syntax

procedure Rectangle(Left, Top, Right, Bottom: Double; StrokeColor: TColor; LineWidth: Double = 1; FillColor: TColor = clNone)

Description

Adds a rectangle page object in one call (no need for MoveTo/LineTo).

Convenience helper equivalent to MoveTo + 3xLineTo + ClosePath + AddPath.

All edits to the current page are buffered in PDFium's in-memory representation. Call UpdatePage to refresh the rendering cache and SaveToFile to persist the changes.

Remarks

Example

begin
  if Pdf1.Active then
  begin
    Pdf1.MoveTo(100, 100);
    Pdf1.LineTo(200, 150);
    Pdf1.LineTo(200, 200);
    Pdf1.ClosePath;
    Pdf1.AddPath(clRed, 1.5, clYellow, fmWinding);
    Pdf1.UpdatePage;
  end;
end;

See Also

AddPath, SetText, AddImage