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 ITextFrame

Properties

PropertiesPropertiesPropertiesProperties
getText() / setText(String)StringRead/WriteContenido de texto plano del marco de texto.
getParagraphs()IParagraphCollectionPropertiesColección de párrafos.
getTextFrameFormat()ITextFrameFormatPropertiesPropiedades de formato del marco de texto.
getParentShape()IShapePropertiesForma padre que posee este marco de texto.
getParentCell()ICellPropertiesCelda de tabla padre (si está dentro de una tabla).
getSlide()IBaseSlidePropertiesDiapositiva padre.
getPresentation()IPresentationPropertiesPresentació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());
}

Ver también

 Español