Hi Antti,

news <[EMAIL PROTECTED]> wrote on 06/27/2007 03:19:50 AM:

>    I have an svg image that I need to rotate (90 or -90 degrees) and 
> rasterize. What is the correct way to do this?
> 
>    I have the rasterizing (to png) already working using the transcoder 
> API. Is it possible to do the rotation at the same time, i.e. use some 
> transcoding hint for this?

   There isn't currently a transcoding hint for this.  It could be
done using an SVG Fragment Identifier:
        http://www.w3.org/TR/SVG11/linking.html#SVGFragmentIdentifiers

   However, I would probably subclass the Transcoder to adjust the
'curTxf' member to include the desired transform.

>    If not, how do I produce a new (rotated) svg from an existing svg? 
All I 
> found on this was how to do it w/ JSVGCanvas, but I need to do this 
w/out 
> starting a gui.

   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.

   The tricky bits of all this is that when you rotate you typically need 
to add a translate to move the document (or provide a viewBox) and that
depends on the dimensions of the image in question.  If you subclass the
Transcoder this information is fairly readily available.


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

Reply via email to