TextFrame — Aspose.Slides FOSS for Java API Reference
Properties TextFrame class mewakili sebuah bingkai teks yang berisi paragraf. Ini mengimplementasikan ITextFrame.
Properties: org.aspose.slides.foss
import org.aspose.slides.foss.*;public class TextFrame implements ITextFrameProperties
| Properties | Properties | Properties | Properties |
|---|---|---|---|
getText() / setText(String) | String | Baca/Tulis | Konten teks biasa dari bingkai teks. |
getParagraphs() | IParagraphCollection | Properties | Koleksi paragraf. |
getTextFrameFormat() | ITextFrameFormat | Properties | Properti pemformatan bingkai teks. |
getParentShape() | IShape | Properties | Bentuk induk yang memiliki bingkai teks ini. |
getParentCell() | ICell | Properties | Sel tabel induk (jika berada dalam tabel). |
getSlide() | IBaseSlide | Properties | Slide induk. |
getPresentation() | IPresentation | Properties | Presentasi induk. |
Contoh Penggunaan
Baca dan Tulis Teks
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);Bekerja dengan Paragraf
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());
}