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: [email protected]
Reporter: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]