https://issues.apache.org/bugzilla/show_bug.cgi?id=46122

           Summary: Problem doing PPT2PNG
           Product: POI
           Version: 3.2-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSLF
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Created an attachment (id=22790)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22790)
The .ppt file that causes all this mess

Hello I'm currently using Apache POI HSLF to convert in application to convert
flowchart Powerpoint files (.ppt) into .png image files. It works ok, normally,
without arrows usually, but I found a new crash while converting a .ppt file.
I have no idea why this is happening.

The sentence that throws NullPointerException is:
/* Code Start */
FileInputStream is = new FileInputStream("greenpe.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();
   graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
   graphics.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
   graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
   graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);
   graphics.setPaint(Color.white);
   graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height));

   Slide s = slide[i];

   try   {      
       s.draw(graphics);
   } catch (NullPointerException e) {
       e.printStackTrace;
   }
/* Code Finish */


This is the stack trace:
StackTrace: java.lang.NullPointerException
        at
org.apache.poi.hslf.model.Picture.getEscherBSERecord(Picture.java:200)
        at org.apache.poi.hslf.model.Picture.getPictureData(Picture.java:180)
        at org.apache.poi.hslf.model.Picture.draw(Picture.java:265)
        at org.apache.poi.hslf.model.ShapeGroup.draw(ShapeGroup.java:280)
        at org.apache.poi.hslf.model.Slide.draw(Slide.java:431)
        at ... (...MyComponent.java:381)


Any idea? Thanks


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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]

Reply via email to