If you are looking for an easy to implement PowerPoint PPT to PDF conversion in Java, then you have come to the right place. Because in this article, we are going to show you how to easily convert PowerPoint PPT to JPG images in a few simple steps.

Java PowerPoint PPT PPTX to PDF

PDF (Portable Document Format) has become the most widely and commonly used digital document format. Since PDF format owns a fixed layout, most of the documents are converted to PDF before they are shared. Among the various document conversions, PowerPoint to PDF is a popular use case. So let’s have a look at how to convert PPT or PPTX to PDF in Java.

Java PowerPoint PPT to PDF Conversions

In this article, we will cover the following conversion scenarios:

Java PPT to PDF Converter Library

For PowerPoint to JPG conversion, we will use Aspose.Slides for Java. It is an amazing presentation manipulation API that provided high-fidelity conversion of PPT slides. You can either download it or add it to your maven-based project using the following repository and dependency information.

<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>23.5</version>
    <classifier>jdk16</classifier>
</dependency>

Convert PPT to PDF in Java

The following are the simple steps to convert your PowerPoint PPT to PDF with default options provided by Aspose.Slides for Java.

  • Load PowerPoint PPT or PPTX file using Presentation object.
  • Call save() method passing the output PDF file name and the output format.

The following code sample shows how to convert a PowerPoint PPT to PDF in Java with default options.

Customize PowerPoint to PDF in Java

Aspose.Slides for Java provides the PdfOptions class to let you customize the PowerPoint to PDF conversion. PdfOptions class lets you specify the JPEG quality, define the behavior of metafiles, set text compression level, PDF compliance level, and other options. The following are the steps to convert a PPT or PPTX file to PDF with customized options.

  • Load PowerPoint PPT or PPTX using Presentation object.
  • Create the object of PdfOptions class.
  • Set/specify the options exposed by the PdfOptions class.
  • Call save() method.

The following code sample shows how to convert PPTX to PDF in Java with customized options.

Java PPT to PDF - Include Hidden Slides

There could be a case when the PowerPoint presentation contains hidden slides. In the default PowerPoint to PDF conversion, Aspose.Slides for Java ignores the hidden slides. However, if you want to include the hidden slides in the converted PDF, you can use PdfOptions.setShowHiddenSlides(true) option.

The following code sample shows how to convert PPT to PDF including hidden slides in Java.

Convert Specific Slide(s) of PPT to PDF

Aspose.Slides for Java also allows selecting the slides that you want to include in the resultant PDF document. You can create an array to specify the slide numbers that you want to include in PowerPoint to PDF conversion and pass that to save() method.

The following code sample shows how to convert specific slides of PowerPoint to PDF in Java.

Convert PPT to Protected PDF in Java

You can also convert the PowerPoint PPT presentation to a password-protected PDF to secure your document. You can set the password using PdfOptions.setPassword(“password”) and pass PdfOptions object to save() method.

The following code sample shows how to convert PowerPoint PPTX to a password-protected PDF in Java.

Convert PowerPoint to PDF with Access Permissions

The PDF format allows you to specify different access permissions such as print permission, permission to add or modify text annotations or form fields, and so on. In accordance with this feature, Aspose.Slides for Java provides the feature of setting permissions for the PDF document which is converted from the PowerPoint presentation. The PdfAccessPermissions class contains a set of flags for different permission types you can apply in PowerPoint presentations to PDF conversion.

The following Java code sample shows how to convert PowerPoint PPT to PDF with access permissions.

Get Free PowerPoint to PDF Converter

You can use Aspose.Slides for Java and convert PPT to PDF without evaluation limitations by getting a free temporary license.

Online PPT to PDF Converter

Use our free online PPT to PDF converter to convert your PowerPoint presentations to PDF. This is a web-based tool that can be accessed from any device having a browser and an internet connection. Also, it does not ask you to create an account.

Conclusion

In this article, you have learned how to convert PowerPoint presentations to PDF in Java. We have also covered how to customize the PPT or PPTX to PDF conversion in Java using different options.

Java PowerPoint to PDF Converter - Read More

Visit the documentation for more details on the features exposed by Aspose.Slides for Java. Download the complete set of source code examples in Java from the GitHub repository. In case you would find an issue or have any questions, feel free to let us know via our forum.

See Also

Tip: Check out a live implementation of the PowerPoint to PDF or PPT to PDF conversion process.