Hi,

I have this sample svg:

<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink=" http://www.w3.org/1999/xlink">
   <script language="_javascript_"><![CDATA[
        function translate(evt, d) {
            var SVGDoc  = evt.target.ownerDocument ;
            var SVGRoot = SVGDoc.documentElement;

            SVGRoot.currentTranslate.x+=d;
            SVGRoot.currentTranslate.y+=d;
   
        }
    ]]></script>
    <circle cx="20" cy="20" r="15" style="fill: blue" 10)"/>
    <rect x="100" y="100" width="50" height="50" style="fill: green" -10)"/>
</svg>


What I do is pan the entire document simply by modifying currentTranslate property of svg root element via ecmascript, but I coudn't find a way to do the same in Java, using Batik and dom api. Is there any glue to this? I need to apply pan and zoom on documents loaded on JSVGCanvas.

I'm not very experienced with svg and Batik, so any help is welcome.

Thanks in advance!

Charles Abreu

Reply via email to