Convert Image to PPT in Java
Convert image files to PPT presentations using Aspose.Slides for Java without Microsoft PowerPoint.
Convert image to PPT in Java
Using
Aspose.Slides for Java
, you can convert an image to a PPT presentation with just a few lines of code:
Java code for converting image to PPT
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.ppt", SaveFormat.Ppt);
} finally {
presentation.dispose();
}Convert Image to PPT using Java
Aspose.Slides for Java
is a presentation processing API that can add image files to slides and save the result as a PPT presentation.
How to convert Image to PPT using Aspose.Slides for Java API
These are the steps to convert Image to PPT in Java.
- Install Aspose.Slides for Java.
- Add a library reference (import the library) to your Java project.
- Create an instance of the
Presentationclass. - Load the image as an
IPPImage. - Save the resulting file as a
PPTpresentation.
Built with Aspose.Slides
Convert Image to PPT Online
The free Aspose.Slides Conversion app is built with Aspose.Slides for Java, the same API as the code above. Open it and see what the API can do with your own Image files.
- Runs in your browser, nothing to install.
- See how Aspose.Slides converts files before you write code.
- Upload Image files and save them as PPT.
- Download the result or convert more files.
Other Supported PowerPoint Conversions
You can also convert files in other formats to PowerPoint.