用php找出Ppt文件的页码

时间:2015-11-20 05:20:15

标签: php powerpoint

我想获取ppt文件的页码。 我的代码:

{{1}}

但它给出了错误:

  

致命错误:未捕获的异常'com_exception',消息'Unable   查找`PresentationDocument':未知名称。 “

2 个答案:

答案 0 :(得分:0)

这是一个问题是由于以下因素。

  1. PHP.ini设置
  2. 文件/文件夹权限
  3. 允许在服务器中启用“
  4. 允许上传尺寸

答案 1 :(得分:0)

我得到了答案,感谢Suyog的努力。

$filename = "aaa.ppt";
$power = new COM("Powerpoint.Application");
$power->visible = True;
$power->Presentations->Open(realpath($filename));
echo $power->ActivePresentation->Slides->Count;  
//$word->ActiveDocument->PrintOut();
$power->ActivePresentation->Close();
$power->Quit();
相关问题