Convert Image to PPTX in Java

Convert image files to PPTX presentations using Aspose.Slides for Java without Microsoft PowerPoint.

Convert Image to PPTX using Java

Aspose.Slides for Java is a presentation processing API that can add image files to slides and save the result as a PPTX presentation.

Convert image to PPTX in Java

Using Aspose.Slides for Java , you can convert an image to a PPTX presentation with just a few lines of code:

Java code for converting image to PPTX

Presentation presentation = new Presentation();
try {
    ISlide slide = presentation.getSlides().get_Item(0);

    byte[] imageData = Files.readAllBytes(Paths.get("image.jpg"));
    IPPImage presentationImage = presentation.getImages().addImage(imageData);
    slide.getShapes().addPictureFrame(ShapeType.Rectangle, 0, 0, 720, 540, presentationImage);

    presentation.save("presentation.pptx", SaveFormat.Pptx);
} finally {
    presentation.dispose();
}

How to convert Image to PPTX using Aspose.Slides for Java API

These are the steps to convert Image to PPTX in Java.

  1. Install Aspose.Slides for Java .

  2. Add a library reference (import the library) to your Java project.

  3. Create an instance of the Presentation class.

  4. Load the image as an IPPImage.

  5. Save the resulting file as a PPTX presentation.

Free Online Converter

Convert presentations and slides online.

Other Supported PowerPoint Conversions

You can also convert files in other formats to PowerPoint.