xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 51105] Generating PDF using iText and PrintTranscoder ignores translucent shapes
Date Fri, 22 Apr 2011 14:41:16 GMT

--- Comment #7 from Thomas Deweese <deweese@apache.org> 2011-04-22 10:41:12 EDT ---
Looking closer at the content the problem appears to be that iText isn't
supporting the way Batik draws elements with group opacity.

So the transparent rectangles are drawn by jChart by using an AlphaComposite
instance and an opaque color (as opposed to using just a transparent color).
Batik maps that to a rect with an opaque fill and group opacity:

         <rect x="467" y="45" width="35" style="clip-path:url(#clipPath2);
fill:white; opacity:0.6; stroke:none;" rx="3" ry="3" height="20" />

iText must have a 'check' where it combines an object drawn with an
AlphaComposite and an opaque color to an object drawn with a transparent color.
So when it gets the drawing commands from jChart it comes out right.

However Batik sees a rectangle with group opacity so it creates an offscreen
image draws the rectangle with opaque white into that offscreen image and the
draws the image to the canvas with transparency (this sequence is more or less
dictated by the SVG standard).  I'm guessing the issue is that the iText
PDF Graphics doesn't know what to do with an image that needs to be drawn with

It would be better if the Batik SVGGraphics2D would optimize this case to a
simple transparent fill color (fill:white; fill-opacity:0.6), but what it is
currently doing isn't wrong (IMHO).

   If you wanted to test this you could replace all the "opacity:0.6" instances
in the SVG with "fill-opacity:0.6".

Good luck.

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: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org

View raw message