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

Δείτε επίσης

 Ελληνικά