Hi Martin,

Martin Morawetz <[EMAIL PROTECTED]> wrote on 01/02/2006 
02:27:01 PM:

> But now I've got a new problem. I would need the size in px.
> I was able to specify the size by using the setSVGCanvasSize()
> Method, but as it just takes a Dimension object without
> identifier (like px...):

   Well 'px' are easy in SVG 'unitless' values are ==
to the same value with 'px'.

> svgGraphics2D.setSVGCanvasSize(new Dimension(width, height));


> The (more direct, I guess) approach:
> 
> //Element svgRoot = svgGenerator.getRoot();
> Element svgRoot = svgGraphics2D.getDOMFactory().getDocumentElement();
> svgRoot.setAttributeNS(null, "height", height + "px");
> svgRoot.setAttributeNS(null, "width", width + "px");
> 
> didn't work. The result again is an almost empty SVG-File.

    For a differnent reason though, you need to ensure you only
get the DocumentElement once.  It creates a new one after you 
request the first one and all drawing goes into that root.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to