Convertendo ppt para png usando Apache Poi

Olá, estou tentando usar a estrutura Apache Poi para converter cada slide de um ppt em um png individual. O problema é que alguns slides estão deformados. Por exemplo, há um slide em que o fundo tem uma cor de arco-íris. E as imagens que estão em alguns slides não aparecem no arquivo .png

aqui está o código:

        FileInputStream is = new FileInputStream(args[0]);

        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("C:\\Users\\Farzad\\Desktop\\slide-" + (i+1) + ".png");
        javax.imageio.ImageIO.write(img, "png", out);
        out.close();
        }