TextFrame — Aspose.Slides FOSS for Java API Reference

Properties TextFrame class mewakili sebuah bingkai teks yang berisi paragraf. Ini mengimplementasikan ITextFrame.

Properties: org.aspose.slides.foss

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

Properties

PropertiesPropertiesPropertiesProperties
getText() / setText(String)StringBaca/TulisKonten teks biasa dari bingkai teks.
getParagraphs()IParagraphCollectionPropertiesKoleksi paragraf.
getTextFrameFormat()ITextFrameFormatPropertiesProperti pemformatan bingkai teks.
getParentShape()IShapePropertiesBentuk induk yang memiliki bingkai teks ini.
getParentCell()ICellPropertiesSel tabel induk (jika berada dalam tabel).
getSlide()IBaseSlidePropertiesSlide induk.
getPresentation()IPresentationPropertiesPresentasi induk.

Contoh Penggunaan

Baca dan Tulis Teks

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

Bekerja dengan Paragraf

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

Lihat Juga

 Bahasa Indonesia