From 797ff02699ee7b976e05e203812ff7ae852be66c Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Mon, 16 Jan 2012 07:00:04 +0000 Subject: [PATCH] added example how to merge .pptx slides git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1231850 13f79535-47bb-0310-9956-ffa450edef68 --- .../content/xdocs/slideshow/xslf-cookbook.xml | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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(); + +
    + -- 2.39.5