Bug 37789 - Problems whem printing svg images
Summary: Problems whem printing svg images
Status: NEEDINFO
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: SVG Viewer (show other bugs)
Version: 1.6
Hardware: Macintosh Mac OS X 10.4
: P2 critical
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-05 16:00 UTC by Gerard M. Davison
Modified: 2009-11-02 04:14 UTC (History)
0 users



Attachments
Example svg image that causes the problem (3.06 KB, image/svg)
2005-12-05 16:01 UTC, Gerard M. Davison
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerard M. Davison 2005-12-05 16:00:12 UTC
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.
Comment 1 Gerard M. Davison 2005-12-05 16:01:08 UTC
Created attachment 17150 [details]
Example svg image that causes the problem
Comment 2 Gerard M. Davison 2005-12-05 16:01:48 UTC
Update:

This bug reproduces both under JDK 1.4 and JDK 1.5 Release 3
Comment 3 Helder Magalhães 2009-11-02 04:14:15 UTC
(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/