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 2017/01/23 00:20:55 UTC

[Bug 60625] New: Rendering issue with background and shape overlayed by image

https://bz.apache.org/bugzilla/show_bug.cgi?id=60625

            Bug ID: 60625
           Summary: Rendering issue with background and shape overlayed by
                    image
           Product: POI
           Version: 3.16-dev
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLF
          Assignee: dev@poi.apache.org
          Reporter: otnateos@gmail.com
  Target Milestone: ---

Created attachment 34662
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34662&action=edit
sample of result from slide 2 and 16 that have issue

Hi,

We are having problem to use POX XSLF with rendering background colour and
rendering shape that overlayed by transparent image?

We test our code to render http://www.slideshare.net/sdeeg/spring-boot into
image/svg but 
- the background is rendered as grey instead of white. 
- a rectangular shape that placed behind a PNG image is rendered. In this case
can be argued that part of shape is behind the PNG image but some of them only
behind transparent section of the image, but Powerpoint and Keynote application
do not render them

Using:
------
POI 3.16-beta1
Batik 1.7

Code to test:
-------------
String presentation = // your downloaded presentation file
String dir = "/tmp/" + UUID.randomUUID().toString();
Files.createDirectory(Paths.get(dir));
XMLSlideShow ppt = new XMLSlideShow(new FileInputStream(presentation));
int i = 1;
for (XSLFSlide slide : ppt.getSlides())
{
    String filename = dir + "/slide-" + i + ".svg";
    org.w3c.dom.Document doc =
org.apache.batik.dom.svg.SVGDOMImplementation.getDOMImplementation()
            .createDocument("http://www.w3.org/2000/svg", "svg", null);
    //Use Batik SVG Graphics2D driver
    SVGGeneratorContext svgContext = SVGGeneratorContext.createDefault(doc);
    SVGGraphics2D graphics = new SVGGraphics2D(svgContext, false);
    graphics.setBackground(Color.WHITE);
    graphics.setSVGCanvasSize(ppt.getPageSize());
    // draw stuff. All the heavy-lifting happens here
    slide.draw(graphics);
    // save the result.
    try (final OutputStreamWriter out = new OutputStreamWriter(new
FileOutputStream(filename), "UTF-8"))
    {
        graphics.stream(out, true);
        out.flush();
    }
    i++;
}

I have tried to fix the background image but seems like setting up the fill
colour is not the correct way to do. I also debug the drawing method for the
layers for shape issue, i can see that the order of drawing is correct that the
bottom most layer is rendered first but seems like the issue lay in the
rectangular shape is rendered first without considering there is another image
that have bounding rectangle on top of it (even though transparent).

If anyway can point out the correct direction to fix the issue going to be
great.

Thanks,

-- 
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


[Bug 60625] Rendering issue with background and shape overlayed by image

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60625

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Andreas Beeker <ki...@apache.org> ---
fixed a few rendering issues with r1782096
and tested it with batik too
added support for slide numbers to XSLF/HSLF

you should add the wingding.ttf to awt for correct bullet rendering - at least
with png output

please give it a try

-- 
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


[Bug 60625] Rendering issue with background and shape overlayed by image

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60625

--- Comment #4 from Johanes Soetanto <ot...@gmail.com> ---
Hi Andreas,

I had a quick test from the nightly built yesterday and from my observation

What works:
- background colour issue is fixed
- the fix for the page works on PPTx export but appear as asterisk if exported
from PPT file

What do not work:
- rectangle border still exist (slide-16.svg)
- (NEW) white background in the middle 1st page is not rendered (slide-1.svg) .
This is quite weird issue, if I save the PPTx file into pre-2003 PPT format
then the white background is rendered correctly. I also tested this one
rendered correctly in 3.16-beta2 (samples in the link below)


Links:
https://www.dropbox.com/sh/ir981cxkutmkxps/AADTcj17KwOnpm26JJBMjgj_a?dl=0

-- 
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


[Bug 60625] Rendering issue with background and shape overlayed by image

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60625

Johanes Soetanto <ot...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Johanes Soetanto <ot...@gmail.com> ---
Thanks Andreas,

Seems like your latest fixes work for the main issue that I reported for this
bug

-- 
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


[Bug 60625] Rendering issue with background and shape overlayed by image

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60625

--- Comment #5 from Andreas Beeker <ki...@apache.org> ---
I've added a few more fixes via r1782706
and r1782712

Both XSLF (support for themes) and HSLF (support for shapes) still have quite a
few problems ... I leave it up to you, to decide when to close the bug ... I
probably close it before we push POI 3.16 final ...

-- 
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


[Bug 60625] Rendering issue with background and shape overlayed by image

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60625

--- Comment #1 from Andreas Beeker <ki...@apache.org> ---
I don't have a LinkedIn account to download something from slideshare ... and I
refuse to register! ... and I don't want to spent more than 15 minutes on how
to download the original .pptx without registration ...

If it's ok copyright-wise and size-wise, please upload that slideshow to
bugzilla ... or if not, send it to my apache email.

Andi

-- 
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


[Bug 60625] Rendering issue with background and shape overlayed by image

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60625

--- Comment #2 from Andreas Beeker <ki...@apache.org> ---
The file is also available at [1] - I've seen a few rendering issues and try to
cope with them (... hopefully soon ...)
As we've also uploaded files from tika runs, I probably will upload it also to
our test corpus, 


[1] https://people.apache.org/~kiwiwings/spring-boot.pptx

-- 
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