# Animate PowerPoint Text in Java

> Create dynamic animated text in PowerPoint and OpenDocument presentations using Aspose.Slides for Java, with easy-to-follow, optimized Java code examples.

Source: https://docs.aspose.com/slides/java/animated-text/
Updated: 2026-08-05


## **Overview**

This article explains how to work with animated text in Aspose.Slides by applying animation effects to individual paragraphs and retrieving the effects already assigned to paragraphs in a text frame. It focuses on the API methods used to add paragraph-level animation and inspect existing paragraph animation effects in a presentation.

## **Add Animation Effects to Paragraphs**

We added the [**addEffect()**](https://reference.aspose.com/slides/java/com.aspose.slides/Sequence#addEffect-com.aspose.slides.IParagraph-int-int-int-) method to the [**Sequence**](https://reference.aspose.com/slides/java/com.aspose.slides/Sequence) and [**ISequence**](https://reference.aspose.com/slides/java/com.aspose.slides/ISequence) classes. This method allows you to add animation effects to a single paragraph. This sample code shows you how to add an animation effect to a single paragraph:

```java
import com.aspose.slides.*;

Presentation presentation = new Presentation("Presentation.pptx");
try {
    // select paragraph to add effect
    IAutoShape autoShape = (IAutoShape)presentation.getSlides().get_Item(0).getShapes().get_Item(0);
    IParagraph paragraph = autoShape.getTextFrame().getParagraphs().get_Item(0);

    // add Fly animation effect to selected paragraph
    IEffect effect = presentation.getSlides().get_Item(0).getTimeline().getMainSequence().
            addEffect(paragraph, EffectType.Fly, EffectSubtype.Left, EffectTriggerType.OnClick);

    presentation.save("AnimationEffectinParagraph.pptx", SaveFormat.Pptx);
} finally {
    if (presentation != null) presentation.dispose();
}
```

## **Get Animation Effects of Paragraphs**

You may decide to find out the animation effects added to a paragraph—for example, in one scenario, you want to get the animation effects in a paragraph because you plan to apply those effects to another paragraph or shape.

Aspose.Slides for Java allows you to get all the animation effects applied to paragraphs contained in a text frame (shape). This sample code shows you how to get the animation effects in a paragraph:

```java
import com.aspose.slides.*;

Presentation pres = new Presentation("Presentation.pptx");
try {
    ISequence sequence = pres.getSlides().get_Item(0).getTimeline().getMainSequence();
    IAutoShape autoShape = (IAutoShape)pres.getSlides().get_Item(0).getShapes().get_Item(0);

    for (IParagraph paragraph : autoShape.getTextFrame().getParagraphs())
    {
        IEffect[] effects = sequence.getEffectsByParagraph(paragraph);

        if (effects.length > 0)
            System.out.println("Paragraph \"" + paragraph.getText() + "\" has " + effects[0].getType() + " effect.");
    }
} finally {
    pres.dispose();
}
```

## **FAQ**

### How do text animations differ from slide transitions, and can they be combined?

Text animations control object behavior over time on a slide, while [transitions](/slides/java/slide-transition/) control how slides change. They’re independent and can be used together; playback order is governed by the animation timeline and the transition settings.

### Are text animations preserved when exporting to PDF or images?

No. PDF and raster images are static, so you’ll see a single state of the slide without motion. To keep movement, use [video](/slides/java/convert-powerpoint-to-video/) or [HTML](/slides/java/export-to-html5/) export.

### Do text animations work in layouts and the slide master?

Effects applied to layout/master objects are inherited by slides, but their timing and interaction with slide-level animations depend on the final sequence on the slide.



## Related articles

- [Animation](https://docs.aspose.com/slides/java/examples/elements/animation/)
- [Animate PowerPoint Charts in Java](https://docs.aspose.com/slides/java/animated-charts/)
- [Apply Shape Animations in Presentations Using Java](https://docs.aspose.com/slides/java/shape-animation/)