使用Java生成PowerPoint 2007/2010文件 [英] Generate PowerPoint 2007/2010 file using Java

查看:170
本文介绍了使用Java生成PowerPoint 2007/2010文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Does anyone know of any API (commercial or open-source) that can generate/edit PowerPoint 2007/2010 presentations through Java. I have a template in the PowerPoint 2007/2010 format that I require to edit/update. So far I have been converting the .pptx file to xml and then editing and storing it back as .pptx. But the file gets corrupted while opening.

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

Is anyone aware of any other method or API that do this in Java?

推荐答案

我们已经以编程方式完成了(目前是闭源,对不起)所以可以提供帮助,但要小心一些问题。

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

其中一个是POI项目(至少去年我们看过它)是不完整的。它没有做PPTX图表 - 这是我们想要的一个功能。事实上,POI网站可能不是最新的,但它们似乎不支持PowerPoint 20087格式( http ://poi.apache.org/slideshow/index.html )。每个人都推荐这个项目,但我们的评估是,通过Java生成PowerPoint 2007文件几乎没用。你的milage可能会有所不同。

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也有一些重大的限制;我没有在PowerPoint 2007中使用图表作为阻塞问题。

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

另一个问题是PowerPoint 2007可能非常错误。我们已经有一些编程生成的PPT文件导致锁定,但在测试时,我们发现我们可以使用PowerPoint 2007中创建的简单PPTX文档重新崩溃和锁定 - 即不是我们的代码。

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.

最后,我们做了以下工作:将一个模板PowerPoint文件解压缩到一个文件夹,然后根据需要,用新值填充模板XML,压缩它,重命名各种元素&作为有效的PPTX将其交付给用户。工作正常,除了人们编辑文件时奇怪的PowerPoint崩溃。如果它有一个市场,我想我们可以将代码打包为web服务(即xml / csv - > PPTX)或组合一个商业软件包,但我们不会免费这样做。

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.

这篇关于使用Java生成PowerPoint 2007/2010文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆