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 TextFrame

Header: include/Aspose/Slides/Foss/text_frame.h


Properties

PropertyAccessorDescription
text()ReadReturns the concatenated text of all paragraphs.
set_text(const std::string&)WriteReplace all text content.

ITextFrame Interface

The ITextFrame interface (from i_text_frame.h) defines:

MethodDescription
text()Get the text content.
set_text(const std::string&)Set the text content.

ITextFrameFormat Interface

The ITextFrameFormat interface controls text frame layout:

PropertyAccessorDescription
margin_left() / set_margin_left(double)Read/WriteLeft margin in points.
margin_right() / set_margin_right(double)Read/WriteRight margin in points.
margin_top() / set_margin_top(double)Read/WriteTop margin in points.
margin_bottom() / set_margin_bottom(double)Read/WriteBottom margin in points.
wrap_text() / set_wrap_text(NullableBool)Read/WriteWhether text wraps.
anchoring_type() / set_anchoring_type(TextAnchorType)Read/WriteVertical text anchoring.
center_text() / set_center_text(NullableBool)Read/WriteWhether 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");

See Also