[EMAIL PROTECTED] wrote:
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'.

I know, a colleague of mine has to include the svg in a pdf File,
and she insists on 'px'. So I've to provide '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.

How? The chart-library we use paints into the SVGGraphics Object.
I've not found a way to get the svg-size set by modifying properties
of the chart-library.

chart.paint(svgGraphics);

Trying to get the DocumentElement after that doesn't work as it
creates a new one as you outlined.

Is there an other way to get the size set? Maybe without
the need to parse the document again and modifying the node?

--
Regards
Martin

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

Reply via email to