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 <[email protected]> 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: [email protected]
> For additional commands, e-mail: [email protected]
>

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

Reply via email to