Convert HTML to PPTX in PHP

Import HTML content into presentation slides and save the result as a PowerPoint PPTX file with Aspose.Slides for PHP via Java.

Convert HTML to PPTX in PHP

Aspose.Slides for PHP via Java can import HTML content into presentation slides and save the resulting presentation as a PowerPoint Open XML file with a few lines of PHP code.

Aspose.Slides provides a straightforward API for HTML-to-PPTX conversion and can also export the imported content to PPT, PDF, images, and other supported formats.

Convert HTML to PPTX using PHP

To convert HTML content to PPTX, create a Presentation, import the HTML with addFromHtml, and call save with SaveFormat::Pptx.

PHP code for converting HTML into PPTX

$presentation = new Presentation();
try {
    $slides = $presentation->getSlides();
    $slides->removeAt(0);

    $htmlContent = file_get_contents("input.html");
    $slides->addFromHtml($htmlContent);

    $presentation->save("output.pptx", SaveFormat::Pptx);
} finally {
    $presentation->dispose();
}

How to convert HTML to PPTX using Aspose.Slides for PHP API

These are the steps to convert HTML to PPTX in PHP.

  1. Install Aspose.Slides for PHP via Java .

  2. Configure Aspose.Slides in your PHP project.

  3. Read the HTML content with file_get_contents and pass it to addFromHtml.

  4. Call save with the output file path and SaveFormat::Pptx.

Free Online Converter

Try our free Conversion app

Convert HTML To Other Supported Formats

You can also convert HTML and save to other file formats. See all supported formats below: