r7_slide_object
Add or remove shapes, text boxes, and images on a PPTX slide, setting geometry, fill, border, text, and font in one call. Replace an image via its id while keeping placement intact.
Instructions
Add or remove objects on a PPTX slide: shapes (rectangle, rounded-rectangle, ellipse/circle, line, arrow, triangle, star, chevron, plus more), text boxes and PNG/JPEG images. An object gets its geometry, fill, border, text and font in the same call. Existing media and relationships are never damaged. Set action "replaceImage" with an existing image object's id to swap its picture while keeping its geometry and placement.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Left edge. A number is EMU; "2cm", "1in", "30px" and "24pt" also work. | |
| y | No | Top edge, same units as x. | |
| bold | No | ||
| caps | No | Capitalisation. | |
| fill | No | Solid fill colour, e.g. "#1F6FEB". Use "none" for no fill. | |
| line | No | Border colour, e.g. "#0B3D91". Use "none" for no border. | |
| name | No | Shape name, so a later call can address it by name. | |
| size | No | Font size in points, e.g. 24. | |
| text | No | Text to put in the new object (single paragraph). | |
| color | No | Font colour, e.g. "#C00000". | |
| level | No | Outline level 0..8. | |
| scale | No | For images with no width or height: render at this multiple of the natural pixel size. | |
| shape | No | For addShape: rectangle, rounded-rectangle, ellipse, circle, line, arrow, triangle, diamond, pentagon, hexagon, star, chevron, plus, cloud, heart, cylinder, cube, donut, pie, or any DrawingML preset name. | |
| width | No | Width, same units as x. | |
| action | Yes | What to do. | |
| arrows | No | Arrow heads for a line: true for one arrow at the end, { head, tail } with triangle/stealth/arrow/diamond/oval. | |
| bullet | No | true adds a bullet, false removes it. Combine with numbered. | |
| family | No | Font name, e.g. "Arial" or "Georgia". Applied to Latin, Cyrillic and complex scripts alike, so Cyrillic does not silently keep the theme font. | |
| height | No | Height, same units as x. | |
| indent | No | First-line indent, e.g. "-18pt". | |
| italic | No | ||
| noFill | No | Remove the fill entirely. | |
| noLine | No | Remove the border entirely. | |
| strike | No | ||
| zOrder | No | Position in the object list; 0 is furthest back. Omit to place the object on top. | |
| spacing | No | Character spacing in points (negative tightens). | |
| filePath | Yes | Path to the PPTX file. | |
| numbered | No | true makes the list numbered instead of bulleted. | |
| objectId | No | For remove/replaceImage: the shape id reported by r7_slide_read. | |
| rotation | No | Clockwise rotation in degrees. | |
| alignment | No | Horizontal paragraph alignment. | |
| highlight | No | Text highlight colour, e.g. "#FFFF00". | |
| imagePath | No | For addImage/replaceImage: path to a PNG, JPEG, GIF, BMP, TIFF or WebP file. PNG and JPEG sizes are read from the file itself. | |
| lineStyle | No | Border dash style: solid, dash, dot, lgDash, sysDot. | |
| lineWidth | No | Border width in points, e.g. 1.5. | |
| underline | No | true for a single underline, false to remove it, or a style: double, heavy, dotted, dash, wavy. | |
| marginLeft | No | Left indent, e.g. "24pt" or EMU as a number. | |
| objectName | No | Alternative to objectId. | |
| outputPath | No | Write to a copy instead of editing in place. | |
| paragraphs | No | Text for the new object, one entry per paragraph; each may be a string or { text, runs?, bullet?, numbered?, alignment? }. | |
| slideIndex | No | 0-based slide position (default 0). | |
| spaceAfter | No | Space after the paragraph, in points. | |
| lineSpacing | No | Proportional line spacing, 1 = single, 1.5 = one and a half. | |
| spaceBefore | No | Space before the paragraph, in points. | |
| transparency | No | Font colour transparency 0..1 (0 = opaque). | |
| paragraphIndex | No | Apply the paragraph options to this single paragraph (0-based) instead of all of them. | |
| verticalAnchor | No | Where the text sits inside its box. | |
| bulletCharacter | No | Custom bullet glyph, e.g. "–". | |
| lockAspectRatio | No | For images: keep the natural aspect ratio when only one of width/height is given (default true). | |
| fillTransparency | No | Fill transparency 0..1 (0 = opaque). | |
| lineTransparency | No | Border transparency 0..1. |