You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2008/10/29 19:43:29 UTC
DO NOT REPLY [Bug 46122] New: Problem doing PPT2PNG
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: dev@poi.apache.org
ReportedBy: greenpe@gmail.com
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46122] Problem doing PPT2PNG
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46122
Yegor Kozlov <ye...@dinom.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2008-11-03 09:57:47 PST ---
Fixed in r710114 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=710114 )
One of the shapes has type=Picture but the reference to picture data is
invalid. I fixed Picture.draw to skip rendering of such "invalid" pictures.
Yegor
--
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org