procedure CreatePath(X, Y: Single; FillMode: TPdfFillMode = fmNone; FillColor: TColor = clBlack; FillAlpha: Byte = $FF; Stroke: Boolean = True; StrokeColor: TColor = clBlack; StrokeAlpha: Byte = $FF; StrokeWidth: Single = 1.0; LineCap: TPdfLineCap = lcDefault; LineJoin: TPdfLineJoin = ljDefault; BlendMode: TPdfBlendMode = bmDefault);
| FillMode | TPdfFillMode. Fill rule for the path interior: fmNone (no fill), fmAlternate (even-odd rule), or fmWinding (non-zero winding rule). Default is fmNone. |
| FillColor | TColor. Fill color applied when FillMode is not fmNone. Default is clBlack. |
| FillAlpha | Byte. Opacity of the fill, where $00 is fully transparent and $FF is fully opaque. Default is $FF. |
| Stroke | Boolean. When True, the path outline is drawn using StrokeColor, StrokeAlpha, and StrokeWidth. Default is True. |
| StrokeColor | TColor. Color of the path outline. Default is clBlack. |
| StrokeAlpha | Byte. Opacity of the stroke, where $00 is fully transparent and $FF is fully opaque. Default is $FF. |
| StrokeWidth | Single. Width of the stroke line in PDF user units (points). Default is 1.0. |
| LineCap | TPdfLineCap. Style applied to open path endpoints: lcDefault, lcButt, lcRound, or lcProjectingSquare. Default is lcDefault. |
| LineJoin | TPdfLineJoin. Style applied at path segment joins: ljDefault, ljMiter, ljRound, or ljBevel. Default is ljDefault. |
| BlendMode | TPdfBlendMode. Compositing blend mode for the path object. Default is bmDefault (normal). |
procedure CreatePath(X, Y, Width, Height: Single; FillMode: TPdfFillMode = fmNone; FillColor: TColor = clBlack; FillAlpha: Byte = $FF; Stroke: Boolean = True; StrokeColor: TColor = clBlack; StrokeAlpha: Byte = $FF; StrokeWidth: Single = 1.0; LineCap: TPdfLineCap = lcDefault; LineJoin: TPdfLineJoin = ljDefault; BlendMode: TPdfBlendMode = bmDefault);
| FillMode | TPdfFillMode. Fill rule for the rectangle interior. Default is fmNone. |
| FillColor | TColor. Fill color for the rectangle. Default is clBlack. |
| FillAlpha | Byte. Opacity of the fill ($00–$FF). Default is $FF. |
| Stroke | Boolean. When True, the rectangle outline is drawn. Default is True. |
| StrokeColor | TColor. Color of the rectangle outline. Default is clBlack. |
| StrokeAlpha | Byte. Opacity of the stroke ($00–$FF). Default is $FF. |
| StrokeWidth | Single. Width of the outline stroke in points. Default is 1.0. |
| LineCap | TPdfLineCap. Line cap style for the rectangle corners. Default is lcDefault. |
| LineJoin | TPdfLineJoin. Line join style for the rectangle corners. Default is ljDefault. |
| BlendMode | TPdfBlendMode. Compositing blend mode. Default is bmDefault. |
CreatePath begins the construction of a new vector path object. It must be called before any of the path-building methods (MoveTo, LineTo, BezierTo, ClosePath), and the sequence must be completed by a call to AddPath to commit the path to the current page.
Two overloads are available. The two-coordinate form CreatePath(X, Y, ...) initializes an empty path with its current point at (X, Y); you then build the shape freely using the path-segment methods. The four-coordinate form CreatePath(X, Y, Width, Height, ...) creates a closed rectangular path directly — no additional segment calls are needed before AddPath.
All visual properties of the path — fill color and rule, stroke color, width, opacity, line cap, line join, and blend mode — are set at creation time via the optional parameters. Default values produce a 1-point black stroked outline with no fill.
Only one path may be under construction at a time. Calling CreatePath again before AddPath discards the previous pending path.
// Draw a filled blue triangle with a 2-pt black outline
Pdf1.NewPage(595, 842);
Pdf1.CreatePath(100, 100, fmWinding, clBlue, $FF, True, clBlack, $FF, 2.0);
Pdf1.LineTo(200, 300);
Pdf1.LineTo(300, 100);
Pdf1.ClosePath;
Pdf1.AddPath;
// Draw a red filled rectangle using the 4-coordinate overload
Pdf1.CreatePath(50, 400, 200, 80, fmWinding, clRed);
Pdf1.AddPath;