You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Eric Hamacher <er...@enetrix.com> on 2008/05/13 20:50:00 UTC

inserting images

 

 

 

Hello again:

 

Hello again:

 

I am successfully inserting images into an existing power point
presentation with the following code:

 

 

    public void insertIntoPPT() throws IOException{

        SlideShow ppt = new SlideShow(new
HSLFSlideShow("c:/test/test.ppt"));

        Slide slide18 = ppt.getSlides()[17];

        Slide slide19 = ppt.getSlides()[18];

        Slide slide20 = ppt.getSlides()[19];

       

        int index = ppt.addPicture(new File("c:/test/background.png"),
Picture.PNG);

        Picture pict = new Picture(index);

        pict.setAnchor(new java.awt.Rectangle(195, 50, 400, 500));

        slide18.addShape(pict); 

        

        index = ppt.addPicture(new
File("c:/test/actreflect_20080512.png"), Picture.PNG);

        pict = new Picture(index);

        pict.setAnchor(new java.awt.Rectangle(195, 50, 400, 500));

        slide19.addShape(pict); 

        

        index = ppt.addPicture(new
File("c:/test/actreflect_20080512.png"), Picture.PNG);

        pict = new Picture(index);

        pict.setAnchor(new java.awt.Rectangle(195, 50, 400, 500));

        slide20.addShape(pict); 

        

        FileOutputStream out = new FileOutputStream("c:/test/test.ppt");

        ppt.write(out);

        out.close();        

    }

 

 

The slides in question already had contained some text.  However, after
insertion of the images, the text loses its bold format.    Am I doing
something wrong?

 

Thanks.

 

 

Regards,

Eric Hamacher

 

******************************

THIS EMAIL IS INTENDED ONLY FOR THE REVIEW OF THE ADDRESSEE(S), AND MAY
CONTAIN CONFIDENTIAL AND LEGALLY PRIVILEGED INFORMATION. INTERCEPTION,
COPYING, DISSEMINATION, OR OTHER USE BY OTHER THAN THE ADDRESSEE(S) IS
PROHIBITED AND MAY BE PENALIZED UNDER APPLICABLE PRIVACY LAWS. IF YOU
RECEIVED THIS EMAIL IN ERROR, PLEASE DELETE IT AND NOTIFY ME BY RETURN
EMAIL TO eric.hamacher@enetrix.com *******************************

 


Re: inserting images

Posted by Yegor Kozlov <ye...@dinom.ru>.
Inserting images should not affect formatting of text. If think it is
a bug, create an issue in bugzilla and upload to it the template and
sample code to reproduce the problem.

Yegor

>  

>  

>  

> Hello again:

>  

> Hello again:

>  

> I am successfully inserting images into an existing power point
> presentation with the following code:

>  

>  

>     public void insertIntoPPT() throws IOException{

>         SlideShow ppt = new SlideShow(new
> HSLFSlideShow("c:/test/test.ppt"));

>         Slide slide18 = ppt.getSlides()[17];

>         Slide slide19 = ppt.getSlides()[18];

>         Slide slide20 = ppt.getSlides()[19];

>        

>         int index = ppt.addPicture(new File("c:/test/background.png"),
> Picture.PNG);

>         Picture pict = new Picture(index);

>         pict.setAnchor(new java.awt.Rectangle(195, 50, 400, 500));

>         slide18.addShape(pict); 

>         

>         index = ppt.addPicture(new
> File("c:/test/actreflect_20080512.png"), Picture.PNG);

>         pict = new Picture(index);

>         pict.setAnchor(new java.awt.Rectangle(195, 50, 400, 500));

>         slide19.addShape(pict); 

>         

>         index = ppt.addPicture(new
> File("c:/test/actreflect_20080512.png"), Picture.PNG);

>         pict = new Picture(index);

>         pict.setAnchor(new java.awt.Rectangle(195, 50, 400, 500));

>         slide20.addShape(pict); 

>         

>         FileOutputStream out = new
> FileOutputStream("c:/test/test.ppt");

>         ppt.write(out);

>         out.close();        

>     }

>  

>  

> The slides in question already had contained some text.  However, after
> insertion of the images, the text loses its bold format.    Am I doing
> something wrong?

>  

> Thanks.

>  

>  

> Regards,

> Eric Hamacher

>  

> ******************************

> THIS EMAIL IS INTENDED ONLY FOR THE REVIEW OF THE ADDRESSEE(S), AND MAY
> CONTAIN CONFIDENTIAL AND LEGALLY PRIVILEGED INFORMATION. INTERCEPTION,
> COPYING, DISSEMINATION, OR OTHER USE BY OTHER THAN THE ADDRESSEE(S) IS
> PROHIBITED AND MAY BE PENALIZED UNDER APPLICABLE PRIVACY LAWS. IF YOU
> RECEIVED THIS EMAIL IN ERROR, PLEASE DELETE IT AND NOTIFY ME BY RETURN
> EMAIL TO eric.hamacher@enetrix.com *******************************

>  



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