xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Weis <maxatdr...@gmail.com>
Subject Re: Batik SVG - how to rotate SVG image
Date Tue, 27 May 2014 17:29:20 GMT
I have not yet work with this lib so much,but the AffineTransformation
as in java.awt.Graphics2D may works if this SVGGraphics2D inherit it?
Can you paint it on a SVGGraphics2D.
In Graphics2D you may use rotate-methods or set the
AffineTransformation-object which class has factory-methods for the

2014-05-27 15:55 GMT+02:00, Tomasz Szołtysek <spliner21@gmail.com>:
> Hello,
> I'm trying to rotate the SVG image using Batik. I have a SVG file that I'm
> opening like this:
> InputStream is =
> this.getClass().getClassLoader().getResourceAsStream("svg/"+name+".svg");
> String parser = XMLResourceDescriptor.getXMLParserClassName();
> SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
> SVGDocument doc = (SVGDocument) f.createDocument("svg/"+name+".svg",is);
> Then I'm trying to rotate it f.ex. 90 degrees (that is not important). Is
> there any other way to achieve this than packing the content to a group
> (<g> tag) and apply transform attribute to the group?
> I was trying to do it using SVGGraphics2D class, but I'm not sure if it is
> possible and if it is, how to do it.
> Thanks in advance,
> --
> Tomasz Szołtysek

To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

View raw message