【发布时间】:2013-12-10 13:00:10
【问题描述】:
我已经使用下面的代码将PPT转换为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>
它只在 http : //localhost 中工作,但如果我在我的网络服务器(cpanel 托管位置)位置使用相同的代码,它会显示以下错误。
致命错误:在第 9 行的 /home/domainname/public_html/index.php 中找不到类“COM”
【问题讨论】:
-
cpanel 如何定位