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, IPresentationComponentEnumerations
| Enumerations | Enumerations |
|---|---|
Paragraph() | Créer un nouveau paragraphe vide. |
Paragraph(String text) | Créer un paragraphe avec du texte. |
Enumerations
| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
getText() / setText(String) | String | Lire/Écrire | Contenu texte brut. |
getPortions() | IPortionCollection | Enumerations | Collection de portions de texte (runs). |
getParagraphFormat() | IParagraphFormat | Enumerations | Mise en forme du paragraphe (alignement, retrait, etc.). |
getSlide() | IBaseSlide | Enumerations | Diapositive parente. |
getPresentation() | IPresentation | Enumerations | Pré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
- TextFrame
- Enumerations
- ParagraphCollection (géré via
TextFrame.getParagraphs())