TextFrame — Aspose.Slides FOSS for Java API Reference
Properties TextFrame La clase representa un marco de texto que contiene párrafos. Implementa ITextFrame.
Properties: org.aspose.slides.foss
import org.aspose.slides.foss.*;public class TextFrame implements ITextFrameProperties
| Properties | Properties | Properties | Properties |
|---|---|---|---|
getText() / setText(String) | String | Read/Write | Contenido de texto plano del marco de texto. |
getParagraphs() | IParagraphCollection | Properties | Colección de párrafos. |
getTextFrameFormat() | ITextFrameFormat | Properties | Propiedades de formato del marco de texto. |
getParentShape() | IShape | Properties | Forma padre que posee este marco de texto. |
getParentCell() | ICell | Properties | Celda de tabla padre (si está dentro de una tabla). |
getSlide() | IBaseSlide | Properties | Diapositiva padre. |
getPresentation() | IPresentation | Properties | Presentación padre. |
Ejemplos de uso
Leer y escribir texto
import org.aspose.slides.foss.*;
Presentation prs = new Presentation("deck.pptx");
ISlide slide = prs.getSlides().get(0);
IAutoShape shape = (IAutoShape) slide.getShapes().get(0);
ITextFrame tf = shape.getTextFrame();
System.out.println("Text: " + tf.getText());
tf.setText("Updated text");
prs.save("updated.pptx", SaveFormat.PPTX);Trabajar con párrafos
ITextFrame tf = shape.getTextFrame();
IParagraphCollection paragraphs = tf.getParagraphs();
for (int i = 0; i < paragraphs.size(); i++) {
IParagraph para = paragraphs.get(i);
System.out.println("Paragraph " + i + ": " + para.getText());
}