You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Laurent Meyer <la...@gmail.com> on 2013/09/08 02:20:16 UTC

Questions

Hi,

I'm learning java and I like to build a small tool for my svg but I got a
problem : all works fine but, to do some improvements, I'd like to know the
width and the height of my input svg, I search around the Web and in your
library how to get them but I didn't find what I was looking for. Do you
have any idea to solve my problem ?

Thanks in advance,

Laurent Meyer

Re: Questions

Posted by Alberto Carrascal <al...@gmail.com>.
Hi Laurent,

A way to do it by hand:

Element elem = doc.getElementById(topElement);
String str = elem.getAttribute("height").trim();
if (str.endsWith("px"))
   str = str.substring(0, str.length() - 2);
double height = Double.parseDouble(str);


2013/9/8 Laurent Meyer <la...@gmail.com>

> Hi,
>
> I'm learning java and I like to build a small tool for my svg but I got a
> problem : all works fine but, to do some improvements, I'd like to know the
> width and the height of my input svg, I search around the Web and in your
> library how to get them but I didn't find what I was looking for. Do you
> have any idea to solve my problem ?
>
> Thanks in advance,
>
> Laurent Meyer
>