You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Antti Karanta <an...@napa.fi> on 2007/07/04 07:42:20 UTC
Re: Rotating and rasterizing an svg image
On Thu, 28 Jun 2007 15:19:35 +0300, Antti Karanta <an...@napa.fi>
wrote:
>>> > You could do this be building a small SVG document dynamically
>>> that
>>> > used
>>> > the 'image' element to pull in the 'real' SVG document. Then you can
>> use
>>> > the transform attribute on the image element to rotate things.
>>>
>> I ment use standard DOM methods to construct the elements.
>>
>> Element img = temp.createElementNS("http://www.w3.org/2000/svg",
>> "image");
>> img.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href",
>> "foo.svg");
>> img.setAttributeNS(null, "transform", "rotate(90)");
>> [....]
>> temp.getRootElement.appendChild(img);
>
In case anyone is interested, I got the rotation working by manipulating
the dom tree so that I inserted a new g element w/ transform="translate(0
702) rotate(-90)" attribute and moved all the other nodes inside that. I
also had to manipulate the viewBox attribute of the root element.
-Antti-
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org