Ziv-Barber / officegen

Standalone Office Open XML files (Microsoft Office 2007 and later) generator for Word (docx), PowerPoint (pptx) and Excell (xlsx) in javascript. The output is a stream.
MIT License
2.66k stars 471 forks source link

Add slides to existing PPTX file? #138

Open jasconius opened 8 years ago

jasconius commented 8 years ago

Does the API support the ability to load in an existing PPTX file and add a slide to that file, as opposed to creating an entirely new file?

Ziv-Barber commented 7 years ago

Sorry, right now it's "write only".

Ziv-Barber commented 7 years ago

But... it may be possible to do if it's just to add a new slide and not to edit existing slides.

shobhitsharma commented 7 years ago

@Ziv-Barber Can you explain how to add new slides to existing pptx stream?

Ziv-Barber commented 7 years ago

I'm thinking about implementing this feature. It's not hard once you have simple slides. But with media files, charts, etc, it's not so easy. I'm thinking about parsing existing pptx files into data that officegen can understand and then we just need some more edit options.

shobhitsharma commented 7 years ago

@Ziv-Barber You are right. I did exactly that as a workaround by parsing officegen's generated XML file into JSON and appending other slides XML data and media files to it, and later merging to single buffer. Sample Code: https://github.com/shobhitsharma/pptx-compose/blob/master/index.js

But it would be cool to have it as an API method.

18876293672 commented 5 years ago

so like as poi of Apach ,it is not easy to develop it