简体   繁体   中英

Solutions to convert & export charts/tables generated from web app using HTML/Javascript to editable Powerpoint (.pptx, .ppt)?

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).

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).

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:

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.

Thanks very much.

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

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

  • api for data extraction (text, pictures, embedded objects, sounds)
  • usermodel api for creating, reading and modifying ppt files

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM