TextFrame

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 ITextFrame

Properties

PropertiesPropertiesPropertiesProperties
getText() / setText(String)Stringקריאה/כתיבהתוכן טקסט פשוט של מסגרת הטקסט.
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());
}

ראה גם

 עברית