Hi, 
Need help in only retaining an existing ppt's slidemaster and create new
layouts. I am using the following code to achieve the same on linux machine
but Null Pointers are scaring me. 

Exception in thread "main" java.lang.NullPointerException 
        at
org.apache.poi.xslf.usermodel.XMLSlideShow.createSlide(XMLSlideShow.java:223) 

Code I am using : 
    
   XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("test.pptx")); 
    
    XSLFSlideMaster defaultMaster = ppt.getSlideMasters()[0]; 
    
    XSLFSlideLayout layout1 =
defaultMaster.getLayout(SlideLayout.VERT_TITLE_AND_TX); 
    XSLFSlide slide1 = ppt.createSlide(layout1); 

    XSLFSlideLayout layout2 =
defaultMaster.getLayout(SlideLayout.SECTION_HEADER); 
    XSLFSlide slide2 = ppt.createSlide(layout2); 

    FileOutputStream out = new FileOutputStream(file); 
    ppt.removeSlide(0); 
    ppt.write(out); 
    out.close();

As told, the above code works perfectly when the pptx is using the default
white and white theme but not  when I make any changes to the master theme. 

Any help would be of great help to me. 

Thanks in Advance, 
Jeevan



--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/How-to-use-Slide-Master-and-create-new-layouts-tp5720085.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