我正在尝试使用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>
答案 0 :(得分:0)
是否可以遍历所有幻灯片并使用Slide.Export?
https://msdn.microsoft.com/en-us/vba/powerpoint-vba/articles/slide-export-method-powerpoint