Slide transitions are used to add visual effects, which occur while moving from one slide to another in a PowerPoint slideshow. You can also set transition sound, speed, duration, and other effects according to the context of your presentation. Accordingly, this article covers how to add slide transitions in PowerPoint PPT using Java.
- Java API to Add Slide Transitions in PowerPoint PPT
- Add Slide Transition in PPT using Java
- Add Advanced Slide Transitions in PPT
- Morph Transition in PowerPoint PPT
Java API to Add Slide Transitions in PowerPoint PPT
In order to add slide transitions in PPTX or PPT presentations, we will use Aspose.Slides for Java. The API allows creating and manipulating PowerPoint and OpenOffice presentations. You can either download the API’s JAR 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>
Add Slide Transition in PPT with Java
The following are the steps to add slide transition in a PowerPoint PPT using Java.
- First, load the PowerPoint presentation using Presentation class.
- Then, sset a slide transition type using SlideShowTransition.setType() method and TransitionType class.
- Finally, save the updated presentation using Presentation.save(String, SaveFormat) method.
The following code sample shows how to set the transition of a slide in a PowePoint presentation.
Add Advanced Slide Transitions in PPT in Java
The following are the steps to set advanced slide transition options such as duration, sound, speed, etc.
- First, load the PowerPoint presentation using Presentation class.
- Then, set a slide transition type using SlideShowTransition.setType() method and TransitionType class.
- Set a advanced effects such as Sound, AdvanceAfterTime, etc. (see list of effects).
- Finally, save the updated presentation using Presentation.save(String, SaveFormat) method.
The following code sample shows how to set advanced slide transition options in a PowerPoint presentation.
Java: Set Morph Transition in PowerPoint PPTX
Aspose.Slides for Java also allows setting the morph transitions, which are used to make smooth animations. The following morph transitions are supported by the API:
- ByObject: Morph transition will be performed considering shapes as indivisible objects.
- ByWord: Morph transition will be performed with transferring text by words where possible.
- ByChar: Morph transition will be performed with transferring text by characters where possible.
The following are the steps to add morph transition in a PowerPoint presentation using Java.
- First, load the PowerPoint presentation using Presentation class.
- Then, set a slide transition type to TransitionType.Morph using SlideShowTransition.setType() method.
- Set morph transition type using IMorphTransition.setMorphType() method.
- Finally, save the updated presentation using Presentation.save(String, SaveFormat) method.
The following code sample shows how to set morph transitions in PowerPoint presentations.
Java API for PPT Slide Transition - Get a Free License
You can use Aspose.Slides for Java without evaluation limitations by requesting a temporary license.
Conclusion
In this article, you have learned how to add slide transitions in PowerPoint presentations using Java. Moreover, you have seen how to set morph transitions in the PPTX/PPT presentations. Apart from this, you can visit the documentation to explore other features of API. Also, you can feel free to let us know about your queries via our forum.
See Also
- Create MS PowerPoint Presentations in Java
- Add Watermark to PowerPoint Slides using Java
- Extract Text from PowerPoint Files using Java
- Add, Connect, Remove, or Clone PowerPoint Shapes in Java
- Convert PowerPoint PPTX/PPT to PNG Images in Java
- Generate Thumbnails for PowerPoint PPTX or PPT using Java
Info: Aspose recently implemented transitions effects in its PowerPoint to Video converter to allow you to create even more stunning and engaging videos based on presentations.