Convert SVG to PPTX in PHP
Add an SVG image to a slide and save the presentation as a PowerPoint PPTX file with Aspose.Slides for PHP via Java.
Convert SVG to PPTX in PHP
Aspose.Slides for PHP via Java can add an SVG image to a presentation slide and save the result as a PowerPoint PPTX file with a few lines of PHP code.
Load the SVG content into a SvgImage, add it to the presentation image collection with addImage, place it on a slide with addPictureFrame, and save the presentation with SaveFormat::Pptx.
Convert SVG to PPTX using PHP
To convert SVG to PPTX, create a Presentation, add the SVG image to its first slide, and call save with SaveFormat::Pptx.
PHP code for converting SVG into PPTX
$presentation = new Presentation();
try {
$slide = $presentation->getSlides()->get_Item(0);
$svgContent = file_get_contents("image.svg");
$svgImage = new SvgImage($svgContent);
$presentationImage = $presentation->getImages()->addImage($svgImage);
$slide->getShapes()->addPictureFrame(
ShapeType::Rectangle, 10, 10, 100, 100, $presentationImage);
$presentation->save("output.pptx", SaveFormat::Pptx);
} finally {
$presentation->dispose();
}
How to convert SVG to PPTX using Aspose.Slides for PHP API
These are the steps to convert SVG to PPTX in PHP.
Install Aspose.Slides for PHP via Java .
Configure Aspose.Slides in your PHP project.
Create a
Presentation, access its first slide, and load the SVG content into aSvgImage.Add the SVG image with
addPictureFrame, then callsavewithSaveFormat::Pptx.
Free Online Converter
Convert SVG to Other Supported Formats
You can also convert SVG files and save them to other supported formats.