- From: John Pollard <john@pollard.net>
- Date: Wed, 22 Feb 2006 19:19:31 +0000
- To: www-svg@w3.org
- Message-Id: <F038CE46-08A6-433B-8230-0655D374235E@pollard.net>
I am attempting to load an SVG graphic from file for display in a
Graphics2D (interface from Jasper Reports).
I have tried various code snippets, such as:
try
{
UserAgent userAgent = new UserAgentAdapter();
DocumentLoader loader = new DocumentLoader(userAgent);
BridgeContext ctx = new BridgeContext(userAgent, loader);
ctx.setDynamic(true);
SVGDocument svgDoc = (SVGDocument) loader.loadDocument
(_url);
GVTBuilder builder = new GVTBuilder();
GraphicsNode graphicsNode = builder.build(ctx, svgDoc);
graphicsNode.paint(graphics);
}
catch (IOException e) {
e.printStackTrace();
}
but always get a stack trace that ends...
at org.apache.batik.css.engine.CSSEngine.parseStyleSheet
(Unknown Source)
at
org.apache.batik.dom.svg.SVGDOMImplementation.createCSSEngine(Unknown
Source)
at
org.apache.batik.dom.ExtensibleDOMImplementation.createCSSEngine
(Unknown Source)
with an error:
org.w3c.dom.DOMException: file:/Volumes/Mirror/InraxUploads/8206/10297:
Invalid CSS document.
The SVG file loads fine into Squiggle.
Thank you for any help.
John
Received on Thursday, 23 February 2006 10:46:27 UTC