I have tried merging two pptx files through java API (Apache POI) It worked for PPTX having only text Content.
I need help to merge two PPTX files without losing charts, tables, images, Themes etc. Are there any open source java API-s for this?
I have tried merging two pptx files through java API (Apache POI) It worked for PPTX having only text Content.
I need help to merge two PPTX files without losing charts, tables, images, Themes etc. Are there any open source java API-s for this?
Disclosure: I work for Plutext
Plutext's Docx4j Enterprise Edition can merge complex presentations. You decide whether the output takes on the look of the first pptx, or retains the individual look/feel of the inputs. As simple usage is like so:
String[] deck = {"deck1.pptx", "deck2.pptx"};
PresentationBuilder builder = new PresentationBuilder();
builder.setThemeTreatment(ThemeTreatment.RESPECT); // preserve appearance of each deck?
for (int i=0 ; i< deck.length; i++) {
// Create a SlideRange representing the slides in this pptx
SlideRange sr = new SlideRange(
(PresentationMLPackage)OpcPackage.load(
new File(DIR_IN + deck[i])));
// Add the slide range to the output
builder.addSlideRange(sr);
}
builder.getResult().save(
new File("OUT_MergeWholePresentations.pptx"));
Docx4j Enterprise Ed is a commercial product. I'm not aware of an open source solution which offers what you want via a high level API. As with POI, you could implement what you want yourself using open source docx4j/pptx4j's low level API, but to do so you'd need a decent understanding of the pptx file format and pptx4j. (docx4j/pptx4j use JAXB; POI uses XML Beans)