使用HTML / Javascript将Web应用程序生成的图表/表格转换并导出为可编辑的Powerpoint(.pptx,.ppt)的解决方案?

时间:2021-04-13 13:04:52

I am building a web app where the user will choose different options to generate tables, charts, graphs, etc. using a front-end interface built with HTML/CSS/Javascript. Once the user configures their tables/charts the app will render them and generate a JSON object that will be saved on the server using Java/Postgresql. Once the user has the table/chart they want, the app needs to let them export the table/chart and programmatically generate a Powerpoint .pptx or .ppt file (as well as a few other formats like Excel, Word, PDF) that is fully editable (not just a static image).

我正在构建一个Web应用程序,用户将使用使用HTML / CSS / Javascript构建的前端界面选择不同的选项来生成表格,图表,图形等。一旦用户配置他们的表/图表,应用程序将呈现它们并生成一个JSON对象,该对象将使用Java / Postgresql保存在服务器上。一旦用户拥有他们想要的表/图表,应用程序需要让他们导出表/图表并以编程方式生成Powerpoint .pptx或.ppt文件(以及其他一些格式,如Excel,Word,PDF)完全可编辑(不仅仅是静态图像)。

I have looked at Apache POI which seems to have good support for Excel but from what I can tell it currently does not support the creation of fully functioning, editable pptx and ppt Powerpoint files (only produces non-editable images).

我看过Apache POI似乎对Excel有很好的支持,但据我所知它目前不支持创建功能齐全,可编辑的pptx和ppt Powerpoint文件(仅生成不可编辑的图像)。

http://poi.apache.org/slideshow/index.html http://comments.gmane.org/gmane.comp.jakarta.poi.user/17749

Another possible option might be to build functionality using OpenXML that will allow the user to specify their table/charts options on the front-end using HTML/Javascript/JSON and have the Powerpoint files (or other Microsoft Office app formats) generated using Javascript as described here:

另一个可能的选择可能是使用OpenXML构建功能,允许用户使用HTML / Javascript / JSON在前端指定他们的表/图表选项,并使用Javascript生成Powerpoint文件(或其他Microsoft Office应用程序格式)这里描述:

http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2012/08/02/working-with-open-xml-documents-using-javascript.aspx

I am trying to find any other possible solutions (preferably non-proprietary open source that would be compatiable with our stack HTML/Javascript/JSON/Java/Postgresql) that provide this functionality and would appreciate any advice or suggestions from anyone that might have experience in this area, has implemented a solution for this or could recommend any other possible solutions.

我试图找到提供此功能的任何其他可能的解决方案(最好是与我们的堆栈HTML / Javascript / JSON / Java / Postgresql兼容的非专有开源),并且会感谢任何可能有经验的人的任何建议或建议在这方面,已经为此实施了解决方案,或者可以推荐任何其他可能的解决方案。

Thanks very much.

非常感谢。

2 个解决方案

#1


0  

You mention POI, but did you see HSLF and XLSF?

你提到POI,但你看到HSLF和XLSF了吗?

HSLF provides a way to read, create or modify PowerPoint presentations. In particular, it provides:

HSLF提供了一种阅读,创建或修改PowerPoint演示文稿的方法。特别是,它提供:

  • api for data extraction (text, pictures, embedded objects, sounds)
  • api用于数据提取(文本,图片,嵌入对象,声音)

  • usermodel api for creating, reading and modifying ppt files
  • usermodel api用于创建,读取和修改ppt文件

XSLF is the POI Project's pure Java implementation of the PowerPoint 2007 OOXML (.xlsx) file format. Whilst HSLF and XSLF provide similar features, there is not a common interface across the two of them at this time.

XSLF是POI Project的PowerPoint 2007 OOXML(.xlsx)文件格式的纯Java实现。虽然HSLF和XSLF提供了类似的功能,但目前它们之间并没有共同的接口。

#2


0  

Another solution might be to use docx4j. However, this requires a substantial understanding of the powerpoint XML format. We are currently looking into the same problem and have found an OK working solution so far using the commercial Aspose libraries.

另一种解决方案可能是使用docx4j。但是,这需要对powerpoint XML格式有充分的了解。我们目前正在研究同样的问题,并且到目前为止使用商业Aspose库找到了一个好的工作解决方案。

UPDATE: It looks like its not so hard to get good results within a day or two. Especially when using pre-built PPTX and XLSX files that are merely adapted and joined.

更新:看起来在一两天内取得好成绩并不是那么难。特别是在使用仅经过调整和连接的预制PPTX和XLSX文件时。

#1


0  

You mention POI, but did you see HSLF and XLSF?

你提到POI,但你看到HSLF和XLSF了吗?

HSLF provides a way to read, create or modify PowerPoint presentations. In particular, it provides:

HSLF提供了一种阅读,创建或修改PowerPoint演示文稿的方法。特别是,它提供:

  • api for data extraction (text, pictures, embedded objects, sounds)
  • api用于数据提取(文本,图片,嵌入对象,声音)

  • usermodel api for creating, reading and modifying ppt files
  • usermodel api用于创建,读取和修改ppt文件

XSLF is the POI Project's pure Java implementation of the PowerPoint 2007 OOXML (.xlsx) file format. Whilst HSLF and XSLF provide similar features, there is not a common interface across the two of them at this time.

XSLF是POI Project的PowerPoint 2007 OOXML(.xlsx)文件格式的纯Java实现。虽然HSLF和XSLF提供了类似的功能,但目前它们之间并没有共同的接口。

#2


0  

Another solution might be to use docx4j. However, this requires a substantial understanding of the powerpoint XML format. We are currently looking into the same problem and have found an OK working solution so far using the commercial Aspose libraries.

另一种解决方案可能是使用docx4j。但是,这需要对powerpoint XML格式有充分的了解。我们目前正在研究同样的问题,并且到目前为止使用商业Aspose库找到了一个好的工作解决方案。

UPDATE: It looks like its not so hard to get good results within a day or two. Especially when using pre-built PPTX and XLSX files that are merely adapted and joined.

更新:看起来在一两天内取得好成绩并不是那么难。特别是在使用仅经过调整和连接的预制PPTX和XLSX文件时。