# Edit OTP in PHP

> Edit OTP presentations in PHP with Aspose.Slides for PHP via Java.

Source: https://products.aspose.com/slides/php-java/editor/otp/
Updated: 2026-07-20



## Edit OTP using Aspose.Slides

[**Aspose.Slides for PHP via Java**](/slides/php-java/) can load, modify, and save OTP presentations. You can edit slide text, add shapes and images, update formatting, and work with other presentation elements through the API.

The following example loads an OTP presentation, adds a rectangle containing text to its first slide, and saves the modified presentation as a new OTP file.

## Edit OTP in PHP

Using [**Aspose.Slides for PHP via Java**](/slides/php-java/), you can add a text shape to an OTP presentation with a few lines of PHP code.

### PHP code for editing OTP

```php
$presentation = new Presentation("input.otp");
try {
    $slide = $presentation->getSlides()->get_Item(0);
    $shape = $slide->getShapes()->addAutoShape(
        ShapeType::Rectangle, 10, 10, 100, 50);
    $shape->getTextFrame()->setText("New text");

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

## How to edit OTP in PHP

Install **Aspose.Slides for PHP via Java**. See [**Installation**](https://docs.aspose.com/slides/php-java/installation/).

Configure Aspose.Slides in your PHP project.

Load the OTP file with the `Presentation` class.

Access the first slide with `get_Item(0)`.

Add a rectangle with `addAutoShape` and set its text with `setText`.

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

## Edit Other Files
