How to use PHP & PowerPoint - Create Slides & Presentations The Learn / Tutorial / Sctipts php programming how to using PHP Create Slides & Presentations
ShotDev Focus:
- PHP & Create Slides & Presentations
Example
php_ppt_slide.php
<html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <? //** Create Object ***// $ppApp = new COM("PowerPoint.Application"); $ppName = "MyPP/MyPPt.ppt"; $strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"]))); // C:/AppServ/www/myphp $ppPres = $ppApp->Presentations->Add(); $ppSlide1 = $ppPres->Slides->Add(1,1); $ppSlide1->Shapes[1]->TextFrame->TextRange->Text = "Welcome to"; $ppSlide1->Shapes[2]->TextFrame->TextRange->Text = "www.ShotDev.Com".chr(13)."Version 2010"; $ppApp->Presentations[1]->SaveAs($strPath."/".$ppName); //$ppApp->Presentations[1]->SaveAs(realpath($ppName)); $ppApp->Quit; $ppApp = null; ?> PowerPoint Created <a href="<?=$ppName?>">Click here</a> to Download. </body> </html>
Create a php file and save to path root-path/myphp/
Run
http://localhost/myphp/php_ppt_slide.php
Screenshot