ODP format is used by OpenOffice to represent the presentation documents. It supports charts, multimedia objects, images, transitions, and much more. In this article, you will learn how to automate the conversion of ODP files to PDF. Particularly, the article covers how to convert an ODP presentation to a PDF file programmatically using Java.
Java API for ODP to PDF Conversion
To convert the ODP files to PDF format, we will use Aspose.Slides for Java. It is a feature-rich API to create and manipulate the presentation documents from within the Java applications. You can either download API’s JAR or add it to your Maven-based project using the following configurations.
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
</repository>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-slides</artifactId>
<version>21.8</version>
<classifier>jdk16</classifier>
</dependency>
Convert an ODP File to PDF
The conversion of ODP files to PDF format is as simple as a pie and can be done in a couple of lines of code. The following are steps to convert ODP presentation to PDF using Java.
- Load ODP file using Presentation class.
- Call Presentation.save(String, SaveFormat) method to convert ODP to PDF.
The following code sample shows how to convert an ODP file to PDF.
Get a Free API 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 convert ODP files to PDF using Java. You can simply install Aspose.Slides for Java and use the provided code in your application. Besides, you can explore more about Aspose.Slides for Java using documentation. The complete source code examples of the API are also available on the GitHub repository. In addition, you can feel free to let us know about your queries via our forum.