I have used below the code for converting PPT to IMG
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?php
$ppApp = new COM("PowerPoint.Application");
$ppApp->Visible = True;
$strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"])));
$FileName = "MyPP";
$ppName = "MySlides.ppt";
//*** Open Document ***//
$ppApp->Presentations->Open(realpath($ppName));
//*** Save Document ***//
$ppApp->ActivePresentation->SaveAs($strPath."/".$FileName,17); //'*** 18=PNG, 19=BMP **'
//$ppApp->ActivePresentation->SaveAs(realpath($FileName),17);
$ppApp->Quit;
$ppApp = null;
?>
PowerPoint Created to Folder <b><?php $FileName?></b>
</body>
</html>
its working only in http : //localhost but if I use this same code in my web-server(cpanel hosted location) location its showing following error.
Fatal error: Class 'COM' not found in /home/domainname/public_html/index.php on line 9
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…