1

I'm trying to find a way to copy the whole slide, and paste it with the formatting of 'as an image' to a blank slide, using POI's APIs. The reason why I'm trying to do this is because I want to save each slide as an image. The POI's Slide.draw() API by itself does not do a very good job of saving the slides' contents to images. For example it cannot draw the following two types of objects:

  1. Tables created on PowerPoint
  2. Charts pasted from Excel

Is there any way to 'copy' and 'paste with formatting (as an image)' via POI, just like you do these two operations on MS PowerPoint running on a Windows, in order to save the slides as they are? Since Slide.draw() works just fine with images, once I paste all the objects as a single flat image onto a slide (using POI), I'll be good to go. Or if there is a better way to save the slides contents as intact as possible, could you please let me know?

The license which comes along with the method needs to be Apache license or otherwise something more permissive.

Also, I read the following post: Programmatically extracting slides as images from a PowerPoint presentation (.PPT)

unoconv is GPL-licensed, so it is not an option for us. JODConverter is LGPL-licensed; I'm not sure if it's acceptable so I will talk to my boss and check.

Then I ran the POI as a command line tool, as suggested by Michael, but I ended up getting the same problem (tables and pasted Excel charts do not show up in the saved images.)

Thanks.

Community
  • 1
  • 1
  • Are you willing to do some work to enhance Apache POI? – Gagravarr Dec 15 '14 at 12:46
  • Thank you, sir, for your comment, and I'd take it as 'POI doesn't do it yet, but are you in the mood for some coding?' While I am certainly interested, this being not quite a 'hobby' project, I find it difficult to find time and explanation to do so right now (or at least it is not likely to make my boss happy.) So POI just does not have the feature of drawing tables and charts pasted from MS Excel at this point in time? – NyankoMania Dec 17 '14 at 04:11
  • If you've tried it and it didn't work, then the functionality probably isn't there. An Excel file pasted into a PowerPoint file isn't "just another table", it's a fully formed Excel file stored in there which runs a full copy of Excel internally. See [the POIFS Embedded files docs](http://poi.apache.org/poifs/embeded.html) for a bit of an overview – Gagravarr Dec 17 '14 at 04:44

0 Answers0