Batik SVG - how to rotate SVG image
Tomasz Szołtysek <[email protected]> Tue, 27 May 2014 15:55:07 +0200
| Newsgroups | gmane.text.xml.batik.user |
|---|---|
| Message-ID | <CAO6_0Ze2x9FoBkBNkwyNhEnwVnthmFH1V1_5H1AoP82Q3W2=jQ@mail.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