TextFrame — Aspose.Slides FOSS for Java API Reference

Properties TextFrame classe représente un cadre de texte contenant des paragraphes. Elle implémente ITextFrame.

Properties: org.aspose.slides.foss

import org.aspose.slides.foss.*;
public class TextFrame implements ITextFrame

Properties

PropertiesPropertiesPropertiesProperties
getText() / setText(String)StringLecture/ÉcritureContenu texte brut du cadre de texte.
getParagraphs()IParagraphCollectionPropertiesCollection de paragraphes.
getTextFrameFormat()ITextFrameFormatPropertiesPropriétés de formatage du cadre de texte.
getParentShape()IShapePropertiesForme parent possédant ce cadre de texte.
getParentCell()ICellPropertiesCellule de tableau parent (si à l’intérieur d’un tableau).
getSlide()IBaseSlidePropertiesDiapositive parent.
getPresentation()IPresentationPropertiesPrésentation parent.

Exemples d’utilisation

Lire et écrire du texte

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

Travailler avec des paragraphes

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

Voir aussi

 Français