Programmatically extracting slides as images from a PowerPoint presentation (.PPT)

好久不见. 提交于 2019-12-02 17:36:38

You should probably give unoconv a try. According to the man page, "unoconv is a command line utility that can convert any file format that OpenOffice can import, to any file format that OpenOffice is capable of exporting. "

So, to convert ppt to, say, png, you do:

unoconv -f png some-slides.ppt

Should that failed, you may try JODConverter or PyODConverter from Art of Solving. For example, you can use JODConverter from command line:

java -jar lib/jodconverter-cli-2.2.0.jar document.ppt document.png

Given your requirement to run on Linux, it's probably easiest to automate OpenOffice.org.

Exporting as HTML will give you a JPEG or PNG image with configurable quality for each slide.

Years ago I used Slide Splitter for Impress for this same exact need. Worked with ppt slides as well and exporting to .jpeg.

If using a web API is an option I would try google docs API. You can upload a ppt document and then download it back in any of the supported formats including pdf and png.

Apache POI is a Java library, but has a command-line utility for converting a PPTX files to PNG files.

To run it, invoke this command inside the root of the library's binary download folder:

java -cp "poi-3.10-FINAL-20140208.jar;poi-ooxml-3.10-FINAL-20140208.jar;poi-ooxml-schemas-3.10-FINAL-20140208.jar;ooxml-lib\dom4j-1.6.1.jar;ooxml-lib\stax-api-1.0.1.jar;ooxml-lib\xmlbeans-2.3.0.jar;lib\commons-codec-1.5.jar;lib\commons-logging-1.1.jar;lib\log4j-1.2.13.jar" org.apache.poi.xslf.util.PPTX2PNG presentation.pptx

It's not 100% perfect--I noticed that it doesn't like WordArt or images that have been cropped from within PowerPoint.

You can use PDFCreator (albeit on Wine)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!