Fatal error: Uncaught exception 'com_exception' with message. while converting ppt to jpg

Ravi Sharma picture Ravi Sharma · May 21, 2012 · Viewed 15.7k times · Source

When I run blow code:

/*** PPT to Image conversion ***/
$ppt_file = 'E:\wamp\www\temp/a.pptx';
$app = new COM("PowerPoint.application") or die("Unable to instantiate PowerPoint");
$app->Visible = true;
$app->Presentations->Open($ppt_file); 
$app->Presentations[1]->SaveAs("E:/tmp/outdir",18);
$app->Presentations[1]->Close();
$app->Quit();
$app = null; 

It gives me one exception :

Fatal error: Uncaught exception 'com_exception' with message 'Source: Microsoft Office PowerPoint 2007
Description: PowerPoint could not open the file.' in E:\wamp\www\temp\video_conversion.php:107 Stack trace: #0 E:\wamp\www\temp\video_conversion.php(107): variant->Open('E:\wamp\www\tem...') #1 {main} thrown in E:\wamp\www\temp\video_conversion.php on line 107

I am unable to figure out what is the problem.

Answer

Johndave Decano picture Johndave Decano · Jul 22, 2012

This is kind of issue is due to the following factors.

  1. PHP.ini settings
  2. Folder Permission
  3. allow open is not enabled in the server
  4. allowed upload size