TextFrame — Aspose.Slides FOSS for Java API Reference
Properties TextFrame کلاس نمایانگر یک فریم متنی حاوی پاراگرافها است. این کلاس پیادهسازی میکند ITextFrame.
Properties: org.aspose.slides.foss
import org.aspose.slides.foss.*;public class TextFrame implements ITextFrameProperties
| Properties | Properties | Properties | Properties |
|---|---|---|---|
getText() / setText(String) | String | Read/Write | محتوای متن ساده فریم متنی. |
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());
}