PathGeometry
PathGeometry is an IDML page item's outline — GeometryPathType contours of PathPointType anchors with Bézier handles, plus PathOpen, and how an Oval is spelled.
PathGeometry records a page item's outline anchor by anchor, with Bézier handles, and it is the shape the item is drawn from.
In short Every page item's outline lives in a PathGeometry inside its <Properties>
child. It holds one or more GeometryPathType contours; each contour holds a
PathPointArray of PathPointType points; each point has an on-curve Anchor and two
Bézier handles. PathOpen on a contour says whether it closes. InDesign draws every shape
from this path, a rectangle and an <Oval> included: an oval is an ellipse only because
its path is one.
The nesting
Rectangle / Oval / Polygon / GraphicLine / TextFrame
└── Properties
└── PathGeometry
└── GeometryPathType PathOpen="false" one contour
└── PathPointArray
├── PathPointType Anchor LeftDirection RightDirection
└── …More than one GeometryPathType makes a compound path.
All coordinates are in the item's own space, which its
ItemTransform maps into the parent.
PathPointType: an anchor and two handles
Each point carries three x y pairs (x first, unlike
GeometricBounds):
Anchor: the point the outline passes through;LeftDirection: the handle controlling the curve that arrives at the anchor;RightDirection: the handle controlling the curve that leaves it.
A handle equal to its anchor means no curve on that side. A rectangle's four points set all three pairs equal, so every segment is straight. InDesign walks a rectangle top-left, bottom-left, bottom-right, top-right.
| Attribute · PathPointType | Values | Paged | paged.set |
|---|---|---|---|
| Anchor | list (pt) | read · written | points[i].anchor |
| LeftDirection | list (pt) | read · written | points[i].left |
| RightDirection | list (pt) | read · written | points[i].right |
GeometryPathType: one contour
PathOpen="false" closes the contour with a segment from the last point back to the
first. PathOpen="true" leaves it open: the shape is a stroke that starts and ends at its
end anchors. A GraphicLine is a two-point open contour, which may be curved; its ends
are its first and last anchors, in the order they are written.
| Attribute · GeometryPathType | Values | Paged | paged.set |
|---|---|---|---|
| PathOpen | boolean | read · written |
A three-anchor contour with PathOpen="true": two segments and no closing one.
Set PathOpen to false and the chevron closes into a triangle.
How an <Oval> is spelled
An <Oval> is drawn from its path like any other shape. InDesign writes an ellipse as
four anchors at the midpoints of its bounding box's edges, in the order bottom, right, top,
left, each with handles along its edge at κ·r from the anchor, where κ = 0.5523 and r is the
half-width (for the horizontal handles) or half-height (for the vertical ones). An <Oval>
whose path is four corner points is drawn by InDesign as a rectangle.
A Rectangle with four corner anchors, and an Oval with InDesign's four mid-edge anchors and κ·r handles: a 240 pt circle.
Corner options
A rectangle's corners can be shaped without changing its path: CornerOption with
CornerRadius applies to all four corners, and TopLeftCornerOption,
TopLeftCornerRadius and their siblings override single corners. The values InDesign
writes are None, RoundedCorner, InverseRoundedCorner, InsetCorner, BevelCorner
and FancyCorner. The path keeps the square corners; the treatment is applied on top.
In Paged: all five treatments draw their own corner geometry, with per-corner radii. Supported · verified On polygons the support is partial.
Parsed, partly rendered
What else rides on a path
- Strokes follow the path:
StrokeWeight,StrokeType(solid, dashed, dotted, striped, wavy and custom stroke styles),StrokeAlignment,EndCap,EndJoin, and line ends on open paths. See page-item types. - Text on a path: a
<TextPath>child flows a story along the item's outline. Supported · verified
Frequently asked questions
How are the path elements nested?
PathGeometry holds GeometryPathType contours; each holds a PathPointArray of
PathPointType points; each point has an Anchor, a LeftDirection and a
RightDirection. The whole block sits inside the item's <Properties>.
What coordinate order do path points use?
x y, horizontal first, in the item's own space. GeometricBounds is the one geometry
value that puts y first.
How do I write an ellipse?
As an <Oval> with four anchors at the edge midpoints (bottom, right, top, left), each
with handles 0.5523 × the radius along its edge. Four corner anchors make InDesign draw a
rectangle, whatever the element is called.
What does PathOpen do?
It decides per contour whether the last point joins back to the first. false (the
default) closes the contour; true leaves it open.
GeometricBounds
GeometricBounds is an IDML element's axis-aligned bounding box in its own space, written in the y-before-x order y1 x1 y2 x2 (top, left, bottom, right).
Compound paths
A compound path packs several GeometryPathType contours into one IDML shape — how a hole is punched with opposite winding, and why each contour closes alone.