xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Armstrong" <armstr...@intalio.com>
Subject problems generating SVG
Date Mon, 09 Apr 2001 23:39:40 GMT
Hi,

I am trying to generate SVG using Batik and the following code which is
lifted from the example on the website:

        DOMImplementation domImpl =
            GenericDOMImplementation.getDOMImplementation();
        Document document = domImpl.createDocument(null, "svg", null);
        SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
        _modeler.paint(svgGenerator);
        //and then I go on to write it out, etc

Now, for a "normal" JPanel (with just some rectangles, text etc drawn on it
with g.drawRect() etc), I have no problems generating the SVG and
subsequently viewing it in Batik.  But when I try to generate SVG for a
JPanel which also has JSVGComponent-derived objects on it, I get the
following exception:

Exception occurred during event dispatching:
java.lang.RuntimeException
	at
org.apache.batik.ext.awt.image.codec.PNGImageEncoder.encode(PNGImageEncoder.
java:812)
	at
org.apache.batik.svggen.ImageHandlerBase64Encoder.encodeImage(ImageHandlerBa
se64Encoder.java:133)
	at
org.apache.batik.svggen.ImageHandlerBase64Encoder.handleHREF(ImageHandlerBas
e64Encoder.java:104)
	at
org.apache.batik.svggen.ImageHandlerBase64Encoder.handleHREF(ImageHandlerBas
e64Encoder.java:56)
	at
org.apache.batik.svggen.DefaultImageHandler.handleImage(DefaultImageHandler.
java:43)
	at org.apache.batik.svggen.SVGGraphics2D.drawImage(SVGGraphics2D.java:487)
	at javax.swing.JComponent.paint(JComponent.java:720)
	at
com.intalio.n3.designer.modeler.PreviewPager.debugUpdateScaledModelerShape(P
reviewPager.java:273)
	at
com.intalio.n3.designer.modeler.PreviewPager.keyPressed(PreviewPager.java:19
6)
	at java.awt.Component.processKeyEvent(Component.java:3679)
	at javax.swing.JComponent.processKeyEvent(JComponent.java:2092)
	at java.awt.Component.processEvent(Component.java:3555)
	at java.awt.Container.processEvent(Container.java:1164)
	at java.awt.Component.dispatchEventImpl(Component.java:2595)
	at java.awt.Container.dispatchEventImpl(Container.java:1213)
	at java.awt.Component.dispatchEvent(Component.java:2499)
	at java.awt.LightweightDispatcher.processKeyEvent(Container.java:2155)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2135)
	at java.awt.Container.dispatchEventImpl(Container.java:1200)
	at java.awt.Window.dispatchEventImpl(Window.java:912)
	at java.awt.Component.dispatchEvent(Component.java:2499)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
	at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)

Has anyone hit anything like this?

Thanks,
Peter Armstrong


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message