【发布时间】:2018-08-20 07:21:13
【问题描述】:
我正在尝试使用 php COM 类将 ppt 幻灯片转换为图像
当我尝试这样做时,我收到以下错误:
Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft Office PowerPoint 2007<br/><b>Description:</b> PowerPoint could not open the file
我使用的代码如下:
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body> <?= $ppApp = new COM("PowerPoint.Application");
$ppApp->Visible = True; $strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"])));
$ppName = "MySlides.ppt"; $FileName = "MyPP"; $ppApp->Presentations->Open(realpath($ppName));
$ppApp->ActivePresentation->SaveAs($strPath."/".$FileName,17); $ppApp->Quit; $ppApp = null;
?> PowerPoint Created to Folder
<b><?=$FileName?></b>
</body>
</html>
【问题讨论】:
-
欢迎来到 StackOverflow。请创建一个最小、完整且可验证的示例。
-
ShotDev.Com 教程 = $ppApp = new COM("PowerPoint.Application"); $ppApp->可见=真; $strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"]))); $ppName = "我的幻灯片.ppt"; $FileName = "我的PP"; $ppApp->Presentations->Open(realpath($ppName)); $ppApp->ActivePresentation->SaveAs($strPath."/".$FileName,17); $ppApp->退出; $ppApp = null; ?> PowerPoint 创建到文件夹 =$FileName?> -
请您提出一个问题。你想做什么?
-
我正在尝试使用 php COM 类将 ppt 幻灯片转换为图像
-
我已将您的 cmets 添加到您的问题中,因此您可以查看如何发布一个好的问题,但除非您有一些详细信息,否则您不会得到任何帮助。请花时间阅读如何在这里发布问题stackoverflow.com/help/mcve
标签: php com jpeg powerpoint