TextFrame — Aspose.Slides FOSS for Java API Reference
Properties TextFrame class predstavlja tekstualni okvir koji sadrži odlomke. Implementira ITextFrame.
Properties: org.aspose.slides.foss
import org.aspose.slides.foss.*;public class TextFrame implements ITextFrameProperties
| Properties | Properties | Properties | Properties |
|---|---|---|---|
getText() / setText(String) | String | Čitanje/Pisanje | Sadržaj običnog teksta tekstualnog okvira. |
getParagraphs() | IParagraphCollection | Properties | Kolekcija odlomaka. |
getTextFrameFormat() | ITextFrameFormat | Properties | Svojstva formatiranja tekstualnog okvira. |
getParentShape() | IShape | Properties | Nadređeni oblik koji posjeduje ovaj tekstualni okvir. |
getParentCell() | ICell | Properties | Nadređena ćelija tablice (ako je unutar tablice). |
getSlide() | IBaseSlide | Properties | Nadređeni slajd. |
getPresentation() | IPresentation | Properties | Nadređena prezentacija. |
Primjeri upotrebe
Čitanje i pisanje teksta
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);Rad s odlomcima
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());
}