This problem was first noticed when working with SVG icons in Oracle JDeveloper 10.1.3; but after further testing can be reproduced using the batik-squiggle.jar application. Simply open the attached umlInterface.svg image using the batik-squiggle.jar and then try to print the resultant image. You will see just a large grey box where the image should be. The follwing exception was seen on the console: java.lang.NullPointerException at org.apache.batik.ext.awt.MultipleGradientPaintContext.<init>(Unknown Source) at org.apache.batik.ext.awt.LinearGradientPaintContext.<init>(Unknown Source) at org.apache.batik.ext.awt.LinearGradientPaint.createContext(Unknown Source) at apple.awt.OSXSurfaceData.setupPaint(OSXSurfaceData.java:707) at apple.awt.OSXSurfaceData.setupGraphicsState(OSXSurfaceData.java:1037) at apple.awt.OSXSurfaceData.setupGraphicsState(OSXSurfaceData.java:965) at apple.awt.OSXSurfaceData.drawfillShape(OSXSurfaceData.java:1298) at apple.awt.CRenderer.drawfillShape(CRenderer.java:536) at apple.awt.CRenderer.fill(CRenderer.java:574) at apple.awt.CRenderer.fill(CRenderer.java:561) at sun.java2d.pipe.ValidatePipe.fill(ValidatePipe.java:142) at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2582) at sun.print.ProxyGraphics2D.fill(ProxyGraphics2D.java:1379) at org.apache.batik.gvt.FillShapePainter.paint(Unknown Source) at org.apache.batik.gvt.CompositeShapePainter.paint(Unknown Source) at org.apache.batik.gvt.ShapeNode.primitivePaint(Unknown Source) at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) at org.apache.batik.gvt.ShapeNode.paint(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Source) at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Source) at org.apache.batik.gvt.CanvasGraphicsNode.primitivePaint(Unknown Source) at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Source) at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) at org.apache.batik.transcoder.print.PrintTranscoder.print(Unknown Source) at apple.awt.CPrinterJob$4.run(CPrinterJob.java:533) at apple.awt.CPrinterJob.printToPathGraphics(CPrinterJob.java:548) at apple.awt.CPrinterJob.printLoop(Native Method) at apple.awt.CPrinterJob.print(CPrinterJob.java:223) at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1200) at org.apache.batik.transcoder.print.PrintTranscoder.print(Unknown Source) at org.apache.batik.apps.svgbrowser.JSVGViewerFrame$9.run(Unknown Source) Interestingly Print to PDF does work while printing from JDeveloper; but not from the PDF printing tool. In wonder if this is something to do with the scaling factor applied when printing from squiggle.
Created attachment 17150 [details] Example svg image that causes the problem
Update: This bug reproduces both under JDK 1.4 and JDK 1.5 Release 3
(In reply to comment #0) > Simply open the attached umlInterface.svg image using the batik-squiggle.jar > and then try to print the resultant image. You will see just a large grey box > where the image should be. I've checked that this no longer reproduces using a the current development version 1.8pre (revision 820114), on Windows XP SP3 and Java 1.6.0_16. The graphics is displays as expected, with no exception shown on console. > The follwing exception was seen on the console: [...] > at apple.awt.OSXSurfaceData.setupPaint(OSXSurfaceData.java:707) This hints towards a Java bug, apparently unrelated to Batik. Is anyone with a Mac able to confirm this using an updated Java version and a Batik nightly build [1]? Thanks. :-) If one can confirm that this no longer reproduces, I'd suggest this issue being marked as "resolved invalid" or "resolved works for me" (given the huge time span). [1] http://mcc.id.au/batik-nightly/