poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Túlio Severiano <tulio.ser...@gmail.com>
Subject Power Point Viewer
Date Fri, 04 Jun 2010 22:05:02 GMT
I'm building a Power point viewer. That can also convert the slider in a JPG
or PNG.

I am using this example. But it does not display the background or text
formatting. Any help?

http://poi.apache.org/slideshow/how-to-shapes.html#Render
<http://poi.apache.org/slideshow/how-to-shapes.html#Render>

FileInputStream is = new FileInputStream("slideshow.ppt");
        SlideShow ppt = new SlideShow(is);
        is.close();

        Dimension pgsize = ppt.getPageSize();

        Slide[] slide = ppt.getSlides();
        for (int i = 0; i < slide.length; i++) {

            BufferedImage img = new BufferedImage(pgsize.width,
pgsize.height, BufferedImage.TYPE_INT_RGB);
            Graphics2D graphics = img.createGraphics();
            //clear the drawing area
            graphics.setPaint(Color.white);
            graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width,
pgsize.height));

            //render
            slide[i].draw(graphics);

            //save the output
            FileOutputStream out = new FileOutputStream("slide-"  +
(i+1) + ".png");
            javax.imageio.ImageIO.write(img, "png", out);
            out.close();
        }

-- 
Atenciosamente,
Túlio Sérgio de Paula Severiano
www.leafmob.com
http://twitter.com/tulioseveriano

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message