poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54188] New: NullPointerException ppt to png
Date Thu, 22 Nov 2012 07:09:30 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54188

            Bug ID: 54188
           Summary: NullPointerException ppt to png
           Product: POI
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSLF
          Assignee: dev@poi.apache.org
          Reporter: vitaliy.chekhunov@gmail.com
    Classification: Unclassified

exception:
java.lang.NullPointerException
        at org.apache.poi.hslf.model.Freeform.getOutline(Freeform.java:248)
        at org.apache.poi.hslf.model.ShapePainter.paint(ShapePainter.java:37)
        at org.apache.poi.hslf.model.TextShape.draw(TextShape.java:561)
        at org.apache.poi.hslf.model.Slide.draw(Slide.java:431)
code:

SlideShow ppt = new SlideShow(fromIS);

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();

    graphics.setPaint(Color.white);
    graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height));
    slide[i].draw(graphics);

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

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


Mime
View raw message