PHPPowerpoint to generate slide show on web page dynamically

1.8k views Asked by At

I want to use PHPPowerpoint to generate slide show on a web page dynamically.. meaning, a user could upload any PPT file. I have to display it's slide show.

Kindly guide me How do I do it using PHPPowerpoint in php?

2

There are 2 answers

0
JamesG On

PHPPowerPoint will not help you achieve your goal. PHPPowerPoint is a library that allows you to create a slide deck and even then, it only creates PPTX files (ie. OpenXML format), not PPT files (proprietary Microsoft format).

I have spent many hours investigating how to achieve what you are looking for (which is basically a clone of slideshare.net) but have not yet found a practical solution. The best low cost suggestion I came across in my investigations was to use OpenOffice in headless mode and have it convert the incoming PPT files to some other format for easier rendering on the page. My guess is that this would be cumbersome at best and there may be some technical barriers to even making that work.

0
Shehroze Farooqi On

I will offer an alternate solution.

When user uploads a ppt, you can make a folder of that ppt name and extract images of every slide and put them in that folder. When you want to view them, just write a simple javascript/jquery slideshow to display them.

For converting ppt slideshow into images you can use com class. Here is a sample code

function extractPPt($exportFolder,$ppt_file){
$app = new COM("PowerPoint.application") or die("Unable to instantiate PowerPoint");
            $app->Visible = true;
            $app->Presentations->Open(realpath($ppt_file)) or die ("Could not open presentation");
            $app->Presentations[1]->SaveAs(realpath($exportFolder),17);
           // $app->Presentations[1]->Close();
            $app->Quit();
            $app = null;               }