使用Java生成PowerPoint 2007/2010文件

sre*_*sad 18 java powerpoint presentationml

有没有人知道任何可以通过Java生成/编辑PowerPoint 2007/2010演示文稿的API(商业或开源).我有一个PowerPoint 2007/2010格式的模板,我需要编辑/更新.到目前为止,我一直在将.pptx文件转换为xml,然后编辑并将其存储为.pptx.但是文件在打开时会被破坏.

是否有人知道在Java中执行此操作的任何其他方法或API?

小智 11

We have done it programmatically (closed source at the moment, sorry) so might be able to help, but beware of a few gotchas.

One is that the POI project (at least when we looked at it last year), was quite incomplete. It didn't do PPTX Charts - which is the one feature we wanted. Infact the POI site may not be upto date, but they don't appear to support PowerPoint 20087 format (http://poi.apache.org/slideshow/index.html). Everybody recommends this project, but our evaluation was that it was pretty much useless for generating PowerPoint 2007 files via Java. Your milage may vary.

Apose also had some significant limitations when we looked at it; not doing Charts in PowerPoint 2007 being the blocking issue for us.

Another issue is that PowerPoint 2007 can be quite buggy. We have had a number of progammatically produced PPT files that caused lock ups, but when testing, we found that we can repro crashes and lock ups with simple PPTX documents created in PowerPoint 2007 - i.e. not our code.

In the end, we did the following: Unpacked a 'template' PowerPoint file to a folder, then on demand, filled the template XML with new values, zipped it up, renaming various elements & delivered it to the user as a valid PPTX. Works OK, other than the odd PowerPoint crash when people edit the file. If there was a market for it, I guess we could package up the code as a webservice (i.e xml/csv -> PPTX) or put together a commerical package, but we wouldn't do it for free.


Jas*_*ext 7

docx4j(apache license)现在包含一个pptx4j组件,可以打开/编辑/保存pptx文件.


Jam*_*mes 5

是.查看http://poi.apache.org/,他们刚刚发布了3.6版,现在支持Office 2007格式文档.最好的部分是它是免费的!