Bug 54188 - NullPointerException ppt to png
Summary: NullPointerException ppt to png
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.8-FINAL
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-22 07:09 UTC by vitaliy
Modified: 2012-11-25 11:54 UTC (History)
0 users



Attachments
sample ppt file (446.50 KB, application/vnd.ms-powerpoint)
2012-11-25 08:02 UTC, vitaliy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vitaliy 2012-11-22 07:09:30 UTC
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();
}
Comment 1 Yegor Kozlov 2012-11-23 10:46:28 UTC
Please upload a sample .ppt file that demonstrates the problem.
Comment 2 vitaliy 2012-11-25 08:02:34 UTC
Created attachment 29631 [details]
sample ppt file
Comment 3 Yegor Kozlov 2012-11-25 11:54:19 UTC
Should be fixed in r1413339

Please try wit hthe latest build from trunk

Yegor