TextFrame — Aspose.Slides FOSS for C++ API Reference
The TextFrame class manages the text content of an AutoShape or table Cell. It contains paragraphs and provides direct text access.
Namespace: Aspose::Slides::Foss
#include <Aspose/Slides/Foss/text_frame.h>class TextFrameHeader: include/Aspose/Slides/Foss/text_frame.h
Properties
| Property | Accessor | Description |
|---|---|---|
text() | Read | Returns the concatenated text of all paragraphs. |
set_text(const std::string&) | Write | Replace all text content. |
ITextFrame Interface
The ITextFrame interface (from i_text_frame.h) defines:
| Method | Description |
|---|---|
text() | Get the text content. |
set_text(const std::string&) | Set the text content. |
ITextFrameFormat Interface
The ITextFrameFormat interface controls text frame layout:
| Property | Accessor | Description |
|---|---|---|
margin_left() / set_margin_left(double) | Read/Write | Left margin in points. |
margin_right() / set_margin_right(double) | Read/Write | Right margin in points. |
margin_top() / set_margin_top(double) | Read/Write | Top margin in points. |
margin_bottom() / set_margin_bottom(double) | Read/Write | Bottom margin in points. |
wrap_text() / set_wrap_text(NullableBool) | Read/Write | Whether text wraps. |
anchoring_type() / set_anchoring_type(TextAnchorType) | Read/Write | Vertical text anchoring. |
center_text() / set_center_text(NullableBool) | Read/Write | Whether text is centered vertically. |
Usage Example
#include <Aspose/Slides/Foss/presentation.h>
using namespace Aspose::Slides::Foss;
Presentation prs("deck.pptx");
auto& shape = prs.slides()[0].shapes()[0];
// If shape is an AutoShape with a TextFrame:
// auto& tf = shape.text_frame();
// std::cout << tf.text() << std::endl;
// tf.set_text("Updated text");