poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svmanoj1220 <svmanoj1...@gmail.com>
Subject Merging of PPTX files in to Single PPTX
Date Thu, 12 Jul 2012 11:04:45 GMT
Hi all,

I am trying to merge two PPTX files into a single PPTX file. I taken the
code from examples and i tried. But for the slides containing Charts are
getting as empty slides and Some Background Images I am not able to get in
the final PPTX. Some of the font colors I am not getting , and font size in
some slides got small. 

import org.apache.poi.xslf.usermodel.*;
 

import java.io.FileInputStream;
import java.io.FileOutputStream;
 

 

public final class PPTMerge {
 

       public static void main(String args[]) throws Exception {
 

 

              System.out.println(" start ");
              XMLSlideShow mergedPptx = new XMLSlideShow();
           String[] inputs = {

"C:\\Users\\Manoj\\Desktop\\sample_1.pptx",

"C:\\Users\\Manoj\\Desktop\\sample_2.pptx",

"C:\\Users\\Manoj\\Desktop\\sample_3.pptx",

"C:\\Users\\Manoj\\Desktop\\sample_4.pptx",

"C:\\Users\\Manoj\\Desktop\\sample_5.pptx",

"C:\\Users\\Manoj\\Desktop\\sample_6.pptx",

"C:\\Users\\Manoj\\Desktop\\sample_7.pptx",

"C:\\Users\\Manoj\\Desktop\\sample_8.pptx"

};
           for(String arg : inputs){
 

               FileInputStream fileInpStream = new FileInputStream(arg);
               XMLSlideShow srcPptx = new XMLSlideShow(fileInpStream);
               fileInpStream.close();
 

               XSLFSlide[] slide = srcPptx.getSlides();
               
               for(XSLFSlide src1 : slide)
                     {
                      mergedPptx.createSlide().importContent(src1);
                     }
           }
 

           FileOutputStream fileOutputStream = new
FileOutputStream("C:\\Users\\Manoj\\Desktop\\sample.pptx");
           mergedPptx.write(fileOutputStream);
           System.out.println("PPTX is created");
           fileOutputStream.close();
 

       }
 

}
I am attaching all the images of the output slides I got as 'new' and the
source ppt as Original. U can see the diff by going through these images..
Can you please help me in how to resolve this.. Can u pls give me the exact
code for retrieving Merged PPTX with out any changes or missing
figures,colors ,etc.

Please see all the attachments for clear understanding of issue.. Please Can
i have a quick reply as there is an urgent requirement

Thanks in advance,

Manoj

Mail: svmanoj1220@gmail.com


http://apache-poi.1045710.n5.nabble.com/file/n5710443/1-new.jpg 
http://apache-poi.1045710.n5.nabble.com/file/n5710443/2-new.jpg 
http://apache-poi.1045710.n5.nabble.com/file/n5710443/3-new.jpg 
http://apache-poi.1045710.n5.nabble.com/file/n5710443/3-Original.jpg 
http://apache-poi.1045710.n5.nabble.com/file/n5710443/4-new.jpg 
http://apache-poi.1045710.n5.nabble.com/file/n5710443/4-Original.jpg 
http://apache-poi.1045710.n5.nabble.com/file/n5710443/5-new.jpg 
http://apache-poi.1045710.n5.nabble.com/file/n5710443/5-Original.jpg 

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Merging-of-PPTX-files-in-to-Single-PPTX-tp5710443.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message