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: otnat...@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-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org