Paragraph — Aspose.Slides FOSS for Java API Reference

Enumerations Paragraph class représente un paragraphe de texte contenant des portions (text runs). Il implémente IParagraph, ISlideComponent, et IPresentationComponent.

Enumerations: org.aspose.slides.foss

import org.aspose.slides.foss.*;
public class Paragraph implements IParagraph, ISlideComponent, IPresentationComponent

Enumerations

EnumerationsEnumerations
Paragraph()Créer un nouveau paragraphe vide.
Paragraph(String text)Créer un paragraphe avec du texte.

Enumerations

EnumerationsEnumerationsEnumerationsEnumerations
getText() / setText(String)StringLire/ÉcrireContenu texte brut.
getPortions()IPortionCollectionEnumerationsCollection de portions de texte (runs).
getParagraphFormat()IParagraphFormatEnumerationsMise en forme du paragraphe (alignement, retrait, etc.).
getSlide()IBaseSlideEnumerationsDiapositive parente.
getPresentation()IPresentationEnumerationsPrésentation parente.

Exemples d’utilisation

La classe Presentation est l’objet racine pour créer, charger et enregistrer des fichiers PowerPoint .pptx dans Aspose.Slides FOSS pour Java. Elle implémente IPresentation.

import org.aspose.slides.foss.*;

Presentation prs = new Presentation("deck.pptx");
IAutoShape shape = (IAutoShape) prs.getSlides().get(0).getShapes().get(0);
IParagraph para = shape.getTextFrame().getParagraphs().get(0);

for (int i = 0; i < para.getPortions().size(); i++) {
    IPortion portion = para.getPortions().get(i);
    System.out.println("Portion: " + portion.getText());
}

IPresentation -> Presentation

IParagraph para = shape.getTextFrame().getParagraphs().get(0);
para.setText("New paragraph text");

Voir aussi

 Français