Skip to Content
MosaicMosaicDocs
Tool Reference

EditPresentation

Edit a PowerPoint (.pptx) presentation: an ordered batch of operations applied atomically and saved as a new version, so if any operation fails nothing is saved.

Starter documentation. Features and account details may differ from this deployment.

EditPresentation

Edit a PowerPoint (.pptx) presentation: an ordered batch of operations applied atomically and saved as a new version, so if any operation fails nothing is saved. To make a new deck from an existing one instead (a translation, a variant, a copy to rework), pass saveAs (when translating, cover every text shape, table cell, chart title and speaker note): the edited deck is created as a new presentation, whose documentId is returned for further batches, and the original is left unchanged; operations may then be empty for a plain copy. ReadPresentation first; address slides and shapes by the ids it reports (slide ids are not slide numbers). Positions and sizes are in points from the slide's top-left corner. Text offsets count characters within a paragraph; \n separates paragraphs. Colors are RRGGBB hex or theme names (accent1-accent6, tx1, tx2, bg1, bg2). Use setText to rewrite a shape's text (it keeps each paragraph's formatting), formatText/formatParagraphs for styling (the whole shape when no range is given), formatBody for a text box's margins, autofit, columns, and Text Direction (vertical or stacked text, in table cells too), addSlide with a layout name for new slides (title and body fill its placeholders), addShape for text boxes, preset shapes, lines, tables, charts, or images, setChartData/setChartType/formatChart for charts the read marks editable, mergeCells/formatCells/setTableStyle/setTableGrid for tables (cell text through the text ops with cell), cropPicture/formatPicture for pictures (crop, fill or fit the frame, brightness, contrast, recolor, transparency), groupShapes/ungroupShape, setSlideLayout, setTransition, setAnimations/addAnimation/removeAnimations for a slide's click-through animations (entrance, emphasis, exit, and motion path effects by name, in playback order; setAnimations replaces the whole list and keeps listed existing ones), setShapeEffects for shadows, glows, soft edges, and reflections (by gallery preset name or options; formatText takes text shadow and glow too), setCustomGeometry to redraw a shape's outline as paths in shape-local points (moveTo/lineTo/cubicBezTo/quadBezTo/arcTo/close; the box follows the paths, keeping its formatting and text), mergeShapes to union/combine/fragment/intersect/subtract overlapping shapes (in selection order; the first shape's formatting and id win), SmartArt through addShape {kind: smartArt, layout, items: [{text, level}], colors, style}, editSmartArt (setText, addNode, deleteNode, promote, demote, moveUp, moveDown, setNodes, setLayout, setColors, setStyle, reset, by the node ids the read lists) and convertSmartArt (to shapes or text), equations with insertEquation (LaTeX-style linear text such as \frac{a}{b}, x^2, \sqrt{x}, \sum_{i=1}^{n}; without shape it makes a new centered text box) and setEquation (an equation stands in its paragraph as one U+FFFC character at the index the read lists; delete it with deleteText over that character), review comments with addComment/replyComment/editComment/resolveComment/deleteComment/deleteAllComments (thread ids from the read; legacy threads can only be edited or deleted; sign them with the user's name), slide masters and layouts by passing a master or layout id (the read lists them, at least 2147483648) as slide to shape, text, table, picture, or background ops so the change reaches every slide using it, plus addLayout/renameLayout/deleteLayout/insertPlaceholder/setLayoutOptions and setBackgroundStyle (1-12), setThemeColors/setThemeFonts to restyle the whole deck through its theme (prefer them over recoloring shapes one by one), setHeaderFooter for slide numbers, dates, and footers (omit slides to apply to all), setSlideSize to change the slide size (scale fit shrinks content to the new size), addSection/renameSection/removeSection/moveSection to organize slides into sections (by the section ids the read reports), setGuides to replace the deck's drawing guides, and replaceText for find-and-replace across the deck. Ids of created slides and shapes are returned with the changed slides as they now read; check them. At most 100 operations.

Parameters

ParameterTypeRequiredDescription
documentIdstringYesPresentation document ID.
operationsEditOp[]NoOrdered operations validated and committed together.
saveAsSaveAsPresentationNoCreate the edited deck as a new presentation instead of changing this one.

On this page