I found a problem with removing some slides. It is only happening for some
slides in some presentations.

I have a three-slide presentation. src.removeSlide(1) removes slide 2 (1 in
0-base). Slide 2 is not there when I open output presentation in PowerPoint
but these files are still inside of the output file: 

ppt/slides/slide2.xml
ppt/slides/_rels/slide2.xml

I did not have this problem with removing slide 1 or 3. Files slide1.xml,
slide3.xml were removed.

This is not a major issue because slide 2 is not visible and its content is
not indexed in my repository I am submitting slides to but I thought I would
let you know.

Below is my program I run. I cannot attach my problematic source three-slide
presentation here (let me know if I can send it over email).

Thank you.

import java.io.*;
import org.apache.poi.xslf.usermodel.*;
/**
 * Remove slide
*/
public final class SplitPresentations {
        public static void main(String args[]) throws Exception {
                XMLSlideShow ppt_exc = new XMLSlideShow();
                for(String arg : args){
                        FileInputStream is = new FileInputStream(arg);
                        XMLSlideShow src = new XMLSlideShow(is);
                        is.close();
                        //remove slide 2 (1 zero base)
                        src.removeSlide(1);
                        FileOutputStream out = new 
FileOutputStream("Present_without_sl_2.pptx");
                        src.write(out);
                        out.close();
                }
        }
}



--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Problem-with-removing-some-slides-with-src-removeSlide-tp5684935.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to