Learning & Integrating web technology and code help directory

How to use PHP & PowerPoint - Create Slides & Presentations

No comments
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
  1. <html>  
  2. <head>  
  3. <title>ShotDev.Com Tutorial</title>  
  4. </head>  
  5. <body>  
  6. <?  
  7. //** Create Object ***//  
  8. $ppApp = new COM("PowerPoint.Application");  
  9. $ppName = "MyPP/MyPPt.ppt";  
  10.   
  11. $strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"]))); // C:/AppServ/www/myphp  
  12. $ppPres = $ppApp->Presentations->Add();  
  13.   
  14. $ppSlide1 = $ppPres->Slides->Add(1,1);  
  15. $ppSlide1->Shapes[1]->TextFrame->TextRange->Text = "Welcome to";  
  16. $ppSlide1->Shapes[2]->TextFrame->TextRange->Text = "www.ShotDev.Com".chr(13)."Version 2010";  
  17.   
  18. $ppApp->Presentations[1]->SaveAs($strPath."/".$ppName);  
  19. //$ppApp->Presentations[1]->SaveAs(realpath($ppName));  
  20.   
  21. $ppApp->Quit;  
  22. $ppApp = null;  
  23.   
  24. ?>  
  25. PowerPoint Created <a href="<?=$ppName?>">Click here</a> to Download.  
  26. </body>  
  27. </html>  
Create a php file and save to path root-path/myphp/
Screenshot
PHP & PowerPoint - Create Slides & Presentations
.
.

No comments :

Post a Comment