aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYegor Kozlov <yegor@apache.org>2012-01-16 07:00:04 +0000
committerYegor Kozlov <yegor@apache.org>2012-01-16 07:00:04 +0000
commit797ff02699ee7b976e05e203812ff7ae852be66c (patch)
tree15024b0a3431ce8b7c951eebf2d9e47d688434d7
parentc15348c0650396c55da3bfa86789b57283fb4dd1 (diff)
downloadpoi-797ff02699ee7b976e05e203812ff7ae852be66c.tar.gz
poi-797ff02699ee7b976e05e203812ff7ae852be66c.zip
added example how to merge .pptx slides
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1231850 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/documentation/content/xdocs/slideshow/xslf-cookbook.xml24
1 files changed, 23 insertions, 1 deletions
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 @@
<li><link href="#Text">Format text</link></li>
<li><link href="#Hyperlinks">Hyperlinks</link></li>
<li><link href="#PPTX2PNG">Convert .pptx slides into images</link></li>
+ <li><link href="#Merge">Merge multiple presentations together</link></li>
</ul>
</section>
<section><title>Cookbok</title>
@@ -276,7 +277,28 @@ Options:
example demonstrates how to use Apache Batik to convert .pptx slides into SVG format.
</p>
</section>
-
+ <anchor id="Merge"/>
+ <section>
+ <title>Merge multiple presentations together</title>
+ <source>
+ 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();
+ </source>
+ </section>
+
</section>
</section>
</body>