a:prstGeom (Preset Geometry)
Specifies a preset geometric shape (rectangle, circle, triangle, etc.) for shape definition.
Description
\:prstGeom\ is the DrawingML element that defines a preset geometric shape. It is defined in ECMA-376 Part 1 §20.1.8.32.
Preset geometries provide built-in shape definitions for common shapes without requiring custom path definitions. This simplifies shape creation and ensures consistency across documents.
Preset geometries enable:
- Easy creation of standard shapes (circles, rectangles, stars, etc.)
- Consistent geometric properties across Office applications
- Adjustable shapes via adjustment handles
- Fast rendering with optimized geometry paths
- Shape libraries for templates and master slides
- Simple geometry without custom path complexity
Preset geometries differ from:
- Custom geometry (\:custGeom) — User-defined shape paths
- Path geometry (\:path) — Custom vector paths within geometries
- Transform (\:xfrm) — Position/size (separate from geometry)
Attributes
| Attribute | Type | Values | Description |
|---|---|---|---|
| \prst\ | String | Preset shape ID | Identifies the preset shape type (e.g., “rect”, “circle”, “triangle”). |
Content Model
\:prstGeom\ structure:
- a:avLst (optional, 0–1) — Adjustment value list for shape customization
The adjustment list allows shapes to be customized (rounded corners, star points, etc.) using adjustment handles.
Child Elements Table
| Element | Occurrence | Type | Description |
|---|---|---|---|
| \:avLst\ | 0–1 | Adjustment List | List of adjustment values for shape customization. |
Preset Shape Reference
Common preset geometry identifiers:
| Preset ID | Shape | Common Use |
|---|---|---|
| \ | ||
| ect\ | Rectangle | Basic box, container |
| \ | ||
| oundRect\ | Rounded Rectangle | Box with rounded corners |
| \ellipse\ | Circle/Ellipse | Circular shape |
| \ riangle\ | Triangle | Pointed shape |
| \ | ||
| tTriangle\ | Right Triangle | Right-angled triangle |
| \diamond\ | Diamond | Rhombus shape |
| \pentagon\ | Pentagon | 5-sided polygon |
| \hexagon\ | Hexagon | 6-sided polygon |
| \star5\ | 5-pointed star | Star shape |
| \star6\ | 6-pointed star | Hexagram |
| \star7\ | 7-pointed star | 7-pointed star |
| \star8\ | 8-pointed star | Octagon star |
| \heart\ | Heart | Heart shape |
| \cloud\ | Cloud | Cloud shape |
| \sun\ | Sun | Sun shape with rays |
| \crescent\ | Crescent | Crescent moon |
| \rrow\ | Arrow | Right-pointing arrow |
| \lowChartProcess\ | Process Box | Flowchart process |
| \lowChartDecision\ | Decision Diamond | Flowchart decision |
| \lowChartInputOutput\ | Input/Output | Flowchart I/O |
| \lowChartTerminator\ | Terminator | Flowchart start/end |
| \lowChartMerge\ | Merge | Flowchart merge |
| \lowChartMultidocument\ | Multiple Documents | Multiple docs |
| \lowChartOfflineStorage\ | Offline Storage | Database |
| \lowChartPredefinedProcess\ | Predefined Process | Subprocess |
| \lowChartInternalStorage\ | Internal Storage | Memory |
| \lowChartExtract\ | Extract | Extract operation |
| \lowChartMergeDocument\ | Merge Document | Document merge |
| \ | ||
| ectangle\ | Rectangle (alt) | Alternative rect |
| \wave\ | Wave | Wavy shape |
| \ eardrop\ | Teardrop | Teardrop shape |
| \plus\ | Plus | Plus sign |
| \minus\ | Minus | Minus sign |
| \multiply\ | Multiply | Multiplication sign |
| \divide\ | Divide | Division sign |
Examples
Simple Rectangle (No Adjustments)
<a:spPr>
<a:xfrm><a:off x="1000000" y="1000000"/><a:ext cx="3000000" cy="2000000"/></a:xfrm>
<a:prstGeom prst="rect">
<a:avLst/>
</a:prstGeom>
</a:spPr>
using DocumentFormat.OpenXml.Drawing;
var spPr = new ShapeProperties();
var transform = new Transform2D();
transform.Append(new Offset { X = 1000000, Y = 1000000 });
transform.Append(new Extents { Cx = 3000000, Cy = 2000000 });
spPr.Append(transform);
var prstGeom = new PresetGeometry { Preset = PresetShapeValues.Rectangle };
prstGeom.Append(new AdjustmentValueList());
spPr.Append(prstGeom);
Rounded Rectangle with Adjustments
<a:prstGeom prst="roundRect">
<a:avLst>
<a:gd name="adj" fmla="*/ 50000 w 100000"/>
</a:avLst>
</a:prstGeom>
var prstGeom = new PresetGeometry { Preset = PresetShapeValues.RoundRectangle };
var avLst = new AdjustmentValueList();
var gd = new GuideEntry
{
Name = "adj",
Formula = "*/ 50000 w 100000" // Adjustment value
};
avLst.Append(gd);
prstGeom.Append(avLst);
Circle/Ellipse
<a:prstGeom prst="ellipse">
<a:avLst/>
</a:prstGeom>
var prstGeom = new PresetGeometry { Preset = PresetShapeValues.Ellipse };
prstGeom.Append(new AdjustmentValueList());
Star (5-pointed)
<a:prstGeom prst="star5">
<a:avLst/>
</a:prstGeom>
var prstGeom = new PresetGeometry { Preset = PresetShapeValues.Star5 };
prstGeom.Append(new AdjustmentValueList());
Flowchart Decision (Diamond)
<a:prstGeom prst="flowChartDecision">
<a:avLst/>
</a:prstGeom>
var prstGeom = new PresetGeometry
{
Preset = PresetShapeValues.FlowChartDecision
};
prstGeom.Append(new AdjustmentValueList());
Heart Shape
<a:prstGeom prst="heart">
<a:avLst/>
</a:prstGeom>
var prstGeom = new PresetGeometry { Preset = PresetShapeValues.Heart };
prstGeom.Append(new AdjustmentValueList());
Shape Categories
Basic Shapes
| Shape | Preset ID | Description |
|---|---|---|
| Rectangle | rect | Basic rectangular shape |
| Rounded Rectangle | roundRect | Rectangle with rounded corners |
| Circle | ellipse | Perfect circle (when width = height) |
| Diamond | diamond | 4-pointed diamond |
| Triangle | triangle | Isosceles triangle |
Arrows
| Arrow Type | Preset ID | Direction |
|---|---|---|
| Right Arrow | rtTriangle | Points right |
| Left Arrow | (custom) | Points left |
| Up Arrow | (custom) | Points up |
| Down Arrow | (custom) | Points down |
| Left-Right Arrow | (custom) | Bidirectional |
Flowchart Shapes
| Shape | Preset ID | Purpose |
|---|---|---|
| Process | flowChartProcess | Standard process |
| Decision | flowChartDecision | Conditional branch |
| Terminator | flowChartTerminator | Start/end point |
| Input/Output | flowChartInputOutput | Data I/O |
| Merge | flowChartMerge | Join/merge point |
Stars & Callouts
| Shape | Preset ID | Style |
|---|---|---|
| 5-Point Star | star5 | Standard star |
| 6-Point Star | star6 | Hexagram |
| 8-Point Star | star8 | Octagon star |
| Rounded Callout | callout1 | Speech bubble |
| Arrow Callout | calloutArrow | Arrow callout |
Adjustment Values
Shape customization via \:avLst:
| Shape | Adjustments | Effect |
|---|---|---|
| roundRect | Corner radius | Control rounded corner size |
| star5 | Inset depth | Control star point sharpness |
| hexagon | Rotation | Rotate hexagon 30° variants |
| cloud | Bubble size | Cloud bubble proportions |
| flowChartDecision | Indent | Diamond point adjustment |
Example adjustment formula:
`
Rendering Behavior
Preset geometry rendering:
| Property | Behavior | Notes |
|---|---|---|
| Fill | Applied to preset shape | Interior colored per fill properties |
| Outline | Applied to preset shape | Stroke per line properties |
| Effects | Applied to bounding box | Shadows, glows apply to overall shape |
| Rotation | Transforms preset | Preset rotates around center |
| Scaling | Proportional stretch | Preserves aspect ratio (normally) |
Common Patterns
Basic Box with Text
xml
<a:prstGeom prst="rect">
<a:avLst/>
</a:prstGeom>
Rounded Box (Office style)
xml
<a:prstGeom prst="roundRect">
<a:avLst>
<a:gd name="adj" fmla="15875"/>
</a:avLst>
</a:prstGeom>
Flowchart Template
xml
<a:prstGeom prst="flowChartDecision">
<a:avLst/>
</a:prstGeom>
Star Badge
xml
<a:prstGeom prst="star5">
<a:avLst/>
</a:prstGeom>
Interaction with Other Elements
Preset geometry works with:
- Transform (\:xfrm) — Position, size, rotation
- Fill (\:solidFill\, etc.) — Interior color
- Line (\:ln) — Outline/border
- Effects (\:effectLst) — Shadows, glows, reflection
- Text body (\:txBody) — Text inside shape
- Adjustment values (\:avLst) — Shape customization
Availability Matrix
Preset geometries available:
| Application | Support | Notes |
|---|---|---|
| PowerPoint | Full | All preset shapes |
| Word | Partial | Common shapes; some limited |
| Excel | Partial | Common shapes; some limited |
| Publisher | Full | All preset shapes |
| Office 2007+ | Baseline | All standard presets |
Notes
Element Characteristics
- Preset-based: Identifies shape by string ID, not geometry data
- Optimized rendering: No custom path calculations needed
- Adjustable: Many shapes support adjustment handles
- Consistent: Same ID = same geometry across Office applications
- Lightweight: Preset ID stored, actual path computed by renderer
Advantages
- File size: Minimal storage (just preset ID + adjustments)
- Consistency: Shapes render identically across applications
- Adjustability: Customizable without custom geometry
- Performance: Optimized rendering paths
- Ease of use: Simple shape creation via preset library
Disadvantages
- Limited flexibility: Cannot create arbitrary custom shapes
- Fixed variants: Only available preset shapes supported
- Adjustment limits: Only shape-specific adjustments available
Compatibility
- Office 2007 and later
- All preset shapes consistently supported
- Older clients render with degradation
- PDF export preserves preset shape rendering
Best Practices
- Use preset geometry for standard shapes
- Consider custom geometry (\:custGeom) only for non-standard needs
- Document which presets are used in templates
- Test preset rendering across Office versions
- Use adjustment values to customize without creating custom geometry
- Combine presets with fill/effects for professional appearance