TextFrame — Aspose.Slides FOSS for Java API Reference
Properties TextFrame class מייצגת מסגרת טקסט המכילה פסקאות. היא מממשת ITextFrame.
Properties: org.aspose.slides.foss
import org.aspose.slides.foss.*;public class TextFrame implements ITextFrameProperties
| Properties | Properties | Properties | Properties |
|---|---|---|---|
getText() / setText(String) | String | קריאה/כתיבה | תוכן טקסט פשוט של מסגרת הטקסט. |
getParagraphs() | IParagraphCollection | Properties | אוסף של פסקאות. |
getTextFrameFormat() | ITextFrameFormat | Properties | מאפייני עיצוב של מסגרת הטקסט. |
getParentShape() | IShape | Properties | הצורה האב שמחזיקה את מסגרת הטקסט הזו. |
getParentCell() | ICell | Properties | תא הטבלה האב (אם בתוך טבלה). |
getSlide() | IBaseSlide | Properties | שקף האב. |
getPresentation() | IPresentation | Properties | המצגת האב. |
דוגמאות שימוש
קריאה וכתיבת טקסט
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);עבודה עם פסקאות
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());
}