TextFrame — Aspose.Slides FOSS for Java API Reference
Properties TextFrame class rappresenta un frame di testo contenente paragrafi. 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 | Lettura/Scrittura | Contenuto di testo semplice del frame di testo. |
getParagraphs() | IParagraphCollection | Properties | Raccolta di paragrafi. |
getTextFrameFormat() | ITextFrameFormat | Properties | Proprietà di formattazione del frame di testo. |
getParentShape() | IShape | Properties | Forma genitore che possiede questo frame di testo. |
getParentCell() | ICell | Properties | Cella di tabella genitore (se all’interno di una tabella). |
getSlide() | IBaseSlide | Properties | Diapositiva genitore. |
getPresentation() | IPresentation | Properties | Presentazione genitore. |
Esempi di utilizzo
Leggere e scrivere testo
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);Lavorare con i paragrafi
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());
}