[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-user
Subject:    Re: HSLF: Slide copying Method()?
From:       Yegor Kozlov <yegor () dinom ! ru>
Date:       2008-02-19 13:36:33
Message-ID: 258939576.20080219163634 () dinom ! ru
[Download RAW message or body]

Copying ppt slides still not implemented.

Below is a sample code which demonstrates the idea.

    public static void main(String[] args) throws Exception {
        //new presentation to copy to
        SlideShow dst = new SlideShow();

        SlideShow src_ppt = new SlideShow(new FileInputStream(args[0]));
        Slide[] src_slide = src_ppt.getSlides();
        for (int i = 0; i < src_slide.length; i++) {
            Slide dst_slide = dst.createSlide();
            System.out.println("copying from " + src_slide[i].getTitle());
            Shape[] src_shape = src_slide[i].getShapes();
            for (int j = 0; j < src_shape.length; j++) {
                dst_slide.addShape(src_shape[j]);
            }
        }

        FileOutputStream out = new FileOutputStream(args[0].replaceAll("\\.ppt", "-copy.ppt"));
        dst.write(out);
        out.close();
    }

Note, this code doesn't work in all cases. Rich text info may be lost,
picture data is not copied and will be lost, etc. I will see if I can
add this functionality by next release.

Regards,
Yegor

> Ive been searching for some ducumentation on how to copy slides to a new
> slideshow. In a forum post dated 4th March 07 it was stated that the method to
> achieve what im after hasn't been written yet. As it was also most a year ago
> now im wondering if this method has been completed. 
> If not is there any help of documentation out there to get my teeth into.
> My goals are to Select slides from five different slideshows, and then create
> a new slideshow with my selection of slides.
>  


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


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic