TextFrame

TextFrame — Aspose.Slides FOSS for Java API Reference

Properties TextFrame class rappresenta un frame di testo contenente paragrafi. Implementa ITextFrame.

Properties: org.aspose.slides.foss

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

Properties

PropertiesPropertiesPropertiesProperties
getText() / setText(String)StringLettura/ScritturaContenuto di testo semplice del frame di testo.
getParagraphs()IParagraphCollectionPropertiesRaccolta di paragrafi.
getTextFrameFormat()ITextFrameFormatPropertiesProprietà di formattazione del frame di testo.
getParentShape()IShapePropertiesForma genitore che possiede questo frame di testo.
getParentCell()ICellPropertiesCella di tabella genitore (se all’interno di una tabella).
getSlide()IBaseSlidePropertiesDiapositiva genitore.
getPresentation()IPresentationPropertiesPresentazione genitore.

Esempi di utilizzo

Leggere e scrivere testo

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

Lavorare con i paragrafi

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

Vedi anche

 Italiano