Skip to content
LpdfDocsv0.24-r1004.10

Lpdf is pre-release. The XML schema and SDK APIs can change between releases.

Path

Draws an arbitrary shape using SVG path data. Supports filled shapes, stroked outlines, and complex curves.

Attribute Type Default Description
d string — Required. SVG path data (M, L, H, V, C, Q, Z)
fill color — Fill color
stroke color — Stroke color
fill-rule string nonzero nonzero or evenodd
stroke-width pt — Stroke width
stroke-dash string — Dash pattern
line-cap string butt butt round square
opacity 0–1 1 Opacity

path does not support anchor. Use absolute coordinates in the d attribute.

<path d="M 200pt 100pt L 350pt 300pt L 50pt 300pt Z"
fill="#1a73e8" opacity="0.8"/>
<path d="M 40pt 200pt L 200pt 200pt M 180pt 185pt L 200pt 200pt L 180pt 215pt"
stroke="#333333" stroke-width="2pt" line-cap="round"/>

Complex shape with a hole (evenodd fill rule)

Section titled “Complex shape with a hole (evenodd fill rule)”
<path d="M 100pt 100pt L 300pt 100pt L 300pt 300pt L 100pt 300pt Z
M 150pt 150pt L 250pt 150pt L 250pt 250pt L 150pt 250pt Z"
fill="#1a73e8" fill-rule="evenodd" opacity="0.6"/>
Command Description
M x y Move to
L x y Line to
H x Horizontal line to
V y Vertical line to
C x1 y1 x2 y2 x y Cubic Bézier
Q x1 y1 x y Quadratic Bézier
Z Close path

Lowercase commands use relative coordinates.

Arcs (A) and the smooth curves S and T are not supported. The engine skips a command it does not know, without an error, so a path that uses one is drawn incompletely. Build arcs from C curves.