Animated text is used to make PowerPoint presentations more attractive and draw the audience’s attention. Various types of animations are applied to the text and shapes according to the context of the presentation. Accordingly, in this article, you will learn how to apply animation to the text in PowerPoint PPT in Java.
- API to Apply Animation to Text in PowerPoint
- Apply Animation to Text in PowerPoint
- Get Animation Effects from a Text in PowerPoint
Java API to Create Animated Text in PowerPoint PPT
To apply animation to the text in PowerPoint presentations, we will use Aspose.Slides for Java. The API offers a wide range of features to create and manipulate PowerPoint and OpenOffice presentations. You can either download the API or install it using the following Maven configurations.
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>http://repository.aspose.com/repo/</url>
</repository>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-slides</artifactId>
<version>21.8</version>
<classifier>jdk16</classifier>
</dependency>
Apply Animation to Text in PowerPoint PPT in Java
Aspose.Slides for Java supports 150+ animation effects, such as Bounce, PathFootball, Zoom, etc. In addition, it provides specific animation effects such as OLEObjectShow and OLEObjectOpen. You can view the complete list of supported animation effects in EffectType enumeration.
The following are the steps to apply animation to text in a PowerPoint presentation using Java.
- First, load the presentation using Presentation class.
- Then, select the desired paragraph in an IParagraph object from the desired slide.
- Apply animation effect to the text using Presentation.getSlides().get_Item(index).getTimeline().getMainSequence().addEffect() method.
- Finally, save the presentation using Presentation.save(String, SaveFormat) method.
The following code sample shows how to create animated text in a PowerPoint PPT in Java.
Java Get Text Animation Effects from PowerPoint PPT
In some cases, you may need to retrieve the information about the animation effect used for a particular piece of text. For example, to use the same effect for some other text in the presentation.
The following are the steps to get information about the animation effect applied to a text.
- First, load the presentation using Presentation class.
- Then, get the sequence of the desired slide in ISequence object.
- Access the shape from the selected slide in an IAutoShape object.
- Loop through each IParagraph in the collection using IAutoShape.getTextFrame().get_Item(index).getParagraphs() method.
- Finally, get the effects in an IEffect array using ISequence.getEffectsByParagraph(iParagraph) method.
The following code sample shows how to get information about a text’s animation effect.
Java API to Create Animated Text in PPT - Get a Free License
You can use Aspose.Slides for Java without evaluation limitations by getting a free temporary license.
Conclusion
In this article, you have learned how to apply animation effects to text in PowerPoint presentations with Java. In addition, the article has also covered how to get animation effects from text in a PowerPoint presentation.
Java PowerPoint API - Read More
You can explore other features of Aspose.Slides for Java using documentation. Also, you can feel free to let us know about your queries via our forum.