# Convert Image to PDF in Java

> Convert Image to PDF in Java. Use Aspose.Slides for Java to add an image to a slide and save it as a PDF document.

Source: https://products.aspose.com/slides/java/conversion/image-to-pdf/
Updated: 2026-07-09



## Convert Image to PDF in Java

[**Aspose.Slides for Java**](/slides/java/) is a presentation processing API that can add image files to slides and save them as `PDF` documents.

You can load an image as an `IPPImage`, place it in a picture frame, and save the presentation with `SaveFormat.Pdf`.

## Convert Image to PDF using Java

To convert an image to `PDF`, add the source image to a `Presentation` and save the result as a `PDF` document.

### Java code for converting Image into PDF

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

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

    presentation.save("image.pdf", SaveFormat.Pdf);
} finally {
    presentation.dispose();
}
```

## How to convert Image to PDF using Aspose.Slides for Java API

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

Install [**Aspose.Slides for Java**](/slides/java/).

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

Load the source image as an `IPPImage`.

Save the presentation with `SaveFormat.Pdf`.

## Convert Image To Other Supported Formats

- [IMAGE TO JPG](/slides/java/conversion/image-to-jpg/)
- [IMAGE TO PPT](/slides/java/conversion/image-to-ppt/)
- [IMAGE TO PPTX](/slides/java/conversion/image-to-pptx/)
