How to convert ppt slide to jpeg images in php

I saw some similar questions on this forum but all those were for .NET platform so please don't close it as duplicate. I have a linux system and I want to convert slide to images via php or shell script(less preferable). the convert command can convert pdf to jpg's but not a ppt.

Any help would be great.


I don't think thats possible. Using .NET would means that the user is creating an instance of a powerpoint application and asking it to print a specific slide to a JPG or PDF but in the case of PHP i don't think it could be possible from a linux system.

In the event you can go on windows server, then you could use the COM interface of PHP to create a COM application and start an installed PowerPoint application and do the same thing as long as the COM component is exposing the necessary methods (probably PRINT())

Good luck


http://code.google.com/p/jodconverter/ seems to have all the building blocks in place, there is even a sample webapp.

We used the old version at http://sourceforge.net/projects/jodconverter/ successfully some time ago, but thI really can't remember the details.


hi you need to enable COM in php.ini then you can try this out

<?php

$ppApp = new COM("PowerPoint.Application");
$ppApp->Visible = True;
$strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"]))); // C:/AppServ/www/myphp
$ppName = "MySlides.ppt";
$FileName = "MyPP";
//*** 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;

?>

链接地址: http://www.djcxy.com/p/10280.html

上一篇: 在pypi上列出多个版本

下一篇: 如何将ppt幻灯片转换为php中的jpeg图像