问题描述
任何人都知道在apache服务器上使用PHP将ppt / pptx幻灯片转换为服务器上的图像的方法吗?
Anyone know of a way to use PHP on an apache server to convert ppt/pptx slides into images on the server?
据我了解,一种方法是在服务器上安装microsoft powerpoint(或openoffice可能?)以便将powerpoint保存为图像?
As I understand it, one way is to install microsoft powerpoint (or openoffice maybe?) on the server in order to save the powerpoint as images?
你将如何在服务器上安装它?
How would you go about installing it on the server?
如果无法在服务器上安装程序怎么办?
What if installing a program on the server is not possible?
我见过用于打开的COM类在本地计算机上启动应用程序并将ppt / pptx保存为图像...但是在远程计算机上,COM类不存在。
I've seen the COM class used to open up the application on a local machine and save the ppt/pptx as images ... but on a remote machine, the COM class does not exist.
任何帮助/潜在客户非常感谢!
Any help/leads would be greatly appreciated!
编辑:
我看到COM类是Windows Only扩展程序..那么还有其他方法吗?
I see that the COM class is a Windows Only Extension ... So then what other ways are there?
再次感谢!
推荐答案
服务器是Amazon EC2实例,因此在大多数情况下,它是唯一的CLI。
The server is an Amazon EC2 instance, so for the most part, its only CLI.
我所做的是:
我已经安装了用于在PHP中使用 exec()
将文档转换为PDF。
I've installed Libreoffice (headless) for converting documents to PDF's using exec()
in PHP.
从那里我使用ghostscript(已安装在服务器上)通过使用 exec()
从生成的PDF中提取图像。
From there I use ghostscript (already installed on the server) to extract images from the generated PDF by using exec()
as well.
这篇关于在apache服务器上使用PHP将ppt / pptx转换为JPG / PNG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!