Edit PPTM in PHP
Load, modify, and save PPTM presentations with Aspose.Slides for PHP via Java.
Edit PPTM using Aspose.Slides
Aspose.Slides for PHP via Java can load, modify, and save macro-enabled PPTM 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 a PPTM presentation, adds a rectangle containing text to its first slide, and saves the modified presentation as a new PPTM file. Existing VBA macros are retained when the presentation is saved with SaveFormat::Pptm.
Edit PPTM in PHP
Using Aspose.Slides for PHP via Java , you can add a text shape to a PPTM presentation with a few lines of PHP code.
PHP code for editing PPTM
$presentation = new Presentation("input.pptm");
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.pptm", SaveFormat::Pptm);
} finally {
$presentation->dispose();
}
How to edit PPTM in PHP
Install Aspose.Slides for PHP via Java. See Installation .
Configure Aspose.Slides in your PHP project.
Load the PPTM file with the
Presentationclass.Access the first slide with
get_Item(0).Add a rectangle with
addAutoShapeand set its text withsetText.Call
savewith the output file path andSaveFormat::Pptm.