Align Shapes

Introduction

Aligning shapes in PowerPoint presentations is an essential feature that allows you to create professionally polished slides and documents. This feature ensures precise arrangement, alignment, and distribution of space between shapes, making the presentation look more organized and easily comprehensible. Use the following method to align shapes on slides and enhance the visual appeal of your presentations.

AlignShapes

API Information

API Type Description Resource
/slides/{name}/slides/{slideIndex}/shapes/align/{alignmentType} POST Aligns shapes to the edge of the slide or aligns them relative to each other. AlignShapes

Request Parameters

Name Type Location Required Description
name string path true The presentation file name.
slideIndex integer path true The 1-based index of the presentation slide.
alignmentType ShapesAlignmentType path true The type of alignment that will be applied to the shapes.
alignToSlide boolean query false If true, the shapes will be aligned to the slide edges; otherwise, they will be aligned to each other. The default is false.
shapes string query false The indices of the shapes to be aligned.
password string header false The password to open the presentation.
folder string query false The folder where the presentation file is located.
storage string query false The storage where the presentation file is located.
subShape string query false The sub-shape path (e.g. “3”, “3/shapes/2”).

In case of Amazon S3 storage folder path starts with Amazon S3 bucket name.

ShapesAlignmentType Values
Name Value Description
AlignLeft 0 Align shapes to the left.
AlignRight 1 Align shapes to the right.
AlignCenter 2 Align shapes to the center.
AlignTop 3 Align shapes to the top.
AlignMiddle 4 Align shapes to the middle.
AlignBottom 5 Align shapes to the bottom.
DistributeHorizontally 6 Distribute shapes horizontally.
DistributeVertically 7 Distribute shapes vertically.

Examples

The document MyPresentation.pptx contains four shapes with the text “Preparation”, “Production”, “Final Processing”, and “Release”. Align the first three shapes to the middle of the slide.

Screenshot of the slide.

cURL Solution

SDK Solutions

The result:

Screenshot of the slide.

SDKs

Check Available SDKs to learn how to add an SDK to your project.