From: Yegor Kozlov Date: Mon, 16 Jan 2012 07:00:04 +0000 (+0000) Subject: added example how to merge .pptx slides X-Git-Tag: REL_3_8_FINAL~80 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=797ff02699ee7b976e05e203812ff7ae852be66c;p=poi.git added example how to merge .pptx slides git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1231850 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/slideshow/xslf-cookbook.xml b/src/documentation/content/xdocs/slideshow/xslf-cookbook.xml index d13624b30b..da0e683e11 100644 --- a/src/documentation/content/xdocs/slideshow/xslf-cookbook.xml +++ b/src/documentation/content/xdocs/slideshow/xslf-cookbook.xml @@ -50,6 +50,7 @@
  • Format text
  • Hyperlinks
  • Convert .pptx slides into images
  • +
  • Merge multiple presentations together
  • Cookbok @@ -276,7 +277,28 @@ Options: example demonstrates how to use Apache Batik to convert .pptx slides into SVG format.

    - + +
    + Merge multiple presentations together + + XMLSlideShow ppt = new XMLSlideShow(); + String[] inputs = {"presentations1.pptx", "presentation2.pptx"}; + for(String arg : inputs){ + FileInputStream is = new FileInputStream(arg); + XMLSlideShow src = new XMLSlideShow(is); + is.close(); + + for(XSLFSlide srcSlide : src.getSlides()){ + ppt.createSlide().importContent(srcSlide); + } + } + + FileOutputStream out = new FileOutputStream("merged.pptx"); + ppt.write(out); + out.close(); + +
    +