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 ITextFrame

Properties

PropertiesPropertiesPropertiesProperties
getText() / setText(String)StringRead/Writeمحتوای متن ساده فریم متنی.
getParagraphs()IParagraphCollectionPropertiesمجموعه‌ای از پاراگراف‌ها.
getTextFrameFormat()ITextFrameFormatPropertiesویژگی‌های قالب‌بندی فریم متنی.
getParentShape()IShapePropertiesشکل والد که این فریم متنی را در اختیار دارد.
getParentCell()ICellPropertiesسلول جدول والد (در صورت وجود در داخل جدول).
getSlide()IBaseSlidePropertiesاسلاید والد.
getPresentation()IPresentationPropertiesارائه والد.

نمونه‌های استفاده

خواندن و نوشتن متن

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());
}

همچنین ببینید

 فارسی