views:

237

answers:

5

Given a Powerpoint presentation in .ppt format, what is the best way to programmatically and using only open source software extract an image representation (in say .jpg or .png) of each slide in the presentation?

The application will run in a Linux server environment, so installing Microsoft Office or Keynote is not an option.

The functionality that I want to achieve programmatically is similar to:

  • Keynote's export functionality (File > Export... > Pictures > JPEG)
  • Powerpoint's save as JPEG functionality (Save As > Other Formats > JPEG)
+2  A: 

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.

0xA3
+7  A: 

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
William
I think it could be the best solution. But you should be aware it depends on open office. Fortunately there is OO headless so you don't have to mess with xvfb.
Maciek Sawicki
+1  A: 

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

Otaku
A: 

You can use PDFCreator (albeit on Wine)

Kedar Soparkar
A: 

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.

jondro