# Convert PNG to PPT in PHP

> Place a PNG image on a slide and save it as PowerPoint PPT in PHP with Aspose.Slides for PHP via Java.

Source: https://products.aspose.com/slides/php-java/conversion/png-to-ppt/
Updated: 2026-07-31



## Convert PNG to PPT in PHP

[**Aspose.Slides for PHP via Java**](/slides/php-java/) lets you place a PNG image on a presentation slide at its original dimensions and save the result as a PowerPoint 97–2003 PPT file.

The PNG is stored as an image on the slide, so the presentation remains editable while the original raster image content is preserved.

## Convert PNG to PPT using PHP

Create a `Presentation`, load the PNG with `Images::fromFile`, match the slide size to the image with `setSize`, add the image with `addPictureFrame`, and call `save` with `SaveFormat::Ppt`.

### PHP code for converting PNG into PPT

```php
$presentation = new Presentation();
try {
    $slide = $presentation->getSlides()->get_Item(0);

    $sourceImage = Images::fromFile("input.png");
    try {
        $embeddedImage = $presentation->getImages()->addImage($sourceImage);
    } finally {
        $sourceImage->dispose();
    }

    $imageWidth = java_values($embeddedImage->getWidth());
    $imageHeight = java_values($embeddedImage->getHeight());

    $presentation->getSlideSize()->setSize(
        $imageWidth, $imageHeight, SlideSizeScaleType::DoNotScale);

    $slide->getShapes()->addPictureFrame(
        ShapeType::Rectangle, 0, 0, $imageWidth, $imageHeight, $embeddedImage);

    $presentation->save("output.ppt", SaveFormat::Ppt);
} finally {
    $presentation->dispose();
}
```

## How to convert PNG to PPT using Aspose.Slides for PHP API

These are the steps to convert PNG to PPT in PHP.

Install [**Aspose.Slides for PHP via Java**](/slides/php-java/).

Create a `Presentation`, access its first slide, and load the PNG with `Images::fromFile`.

Set the slide dimensions with `setSize`, then place the image on the slide with `addPictureFrame`.

Call `save` with the output file path and `SaveFormat::Ppt`.

## Convert PNG To Other Supported Formats

- [PNG TO HTML](/slides/php-java/conversion/png-to-html/)
- [PNG TO JPG](/slides/php-java/conversion/png-to-jpg/)
- [PNG TO PDF](/slides/php-java/conversion/png-to-pdf/)
- [PNG TO SVG](/slides/php-java/conversion/png-to-svg/)
- [PNG TO PPTX](/slides/php-java/conversion/png-to-pptx/)
