Thanks Yegor, That is actually what I am doing as well. But this works only if there is one slide in the .pptx file.
When there is more than 1 slide, the program throws the org.apache.xmlbeans.impl.values.XmlValueDisconnectedException Did your test include multiple slides? rohit ________________________________ From: Yegor Kozlov-4 [via Apache POI] <[email protected]> To: rohit_sh1 <[email protected]> Sent: Friday, June 15, 2012 12:45:51 AM Subject: Re: XSLF copy slides Here is the code that worked for me: for(XSLFSlide srcSlide : src.getSlides()){ XSLFSlide newSlide = ppt.createSlide(); XSLFSlideLayout src_sl = srcSlide.getSlideLayout(); XSLFSlideMaster src_sm = srcSlide.getSlideMaster(); XSLFSlideLayout new_sl = newSlide.getSlideLayout(); XSLFSlideMaster new_sm = newSlide.getSlideMaster(); // copy source layout to the new layout new_sl.importContent(src_sl); // copy source master to the new master new_sm.importContent(src_sm); newSlide.importContent(srcSlide); } Note that you should import layout into layout and master into master, not master to slide as in you code snippet. Yegor On Fri, Jun 15, 2012 at 12:25 AM, rohit_sh1 <[hidden email]> wrote: > Hi Yegor, > > I was wondering if you had any chance to look at my code and Stack trace. > ANy assistance you can provide will be extremely helpful and appreciated. > > Rohit > > -- > View this message in context: > http://apache-poi.1045710.n5.nabble.com/XSLF-copy-slides-tp5147500p5710195.html > Sent from the POI - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] ________________________________ If you reply to this email, your message will be added to the discussion below:http://apache-poi.1045710.n5.nabble.com/XSLF-copy-slides-tp5147500p5710203.html To unsubscribe from XSLF copy slides, click here. NAML -- View this message in context: http://apache-poi.1045710.n5.nabble.com/XSLF-copy-slides-tp5147500p5710214.html Sent from the POI - User mailing list archive at Nabble.com.
