poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shevchuk Vasyl <vasyl.shevchuk...@gmail.com>
Subject Apache POI 3.14 issue with tables in PPTX files
Date Wed, 25 May 2016 08:43:50 GMT
Hi everybody,

Sorry if I write to incorrect group, but I have not found any other
appropriate mailing group to clarify my issue.

I try to use your library to ganerate PNG images from PPTX slides.
Everything works fine except one issue with tables. Any tables in PPTX
files are not drawing on images. (I've tried to attach archive with sample
files but there is some email size limitation on your side. Just take a
look on file "45545_Comment.pptx" in your samples, slide 8, for example)

I spent some time to investigate this issue and have found the following
interesting part of code.

In the org.apache.poi.sl.draw.DrawTableShape class there is a method draw

    public void draw(Graphics2D graphics) {
        Drawable d = getDrawable(graphics);
        if (d != null) {
            d.draw(graphics);
        }
    }

it's call method getDrawable

    protected Drawable getDrawable(Graphics2D graphics) {
        if (shape instanceof GroupShape) {
            DrawFactory df = DrawFactory.getInstance(graphics);
            return df.getDrawable((GroupShape<?,?>)shape);
        }
        return null;
    }

It's very strange. DrawTableShape class works with TableShape shape class
which is not instance of GroupShape interface. This method will always
return null and method draw will never execute "d.draw(graphics);" part of
code.
Also, I've noticed separate DrawGroupShape.java class for drawing
GroupShapes... Seems to some copy/paste issue.

I've reviewed few previous versions of library and have found the same.

Could you please clarify for me this strange part of code, or fix this bug.

Best regards,
Senior Software Developer,
Skype: vasylshevchuk
Cell: +380661044415
Vasyl Shevchuk

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message