You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by David Gellman <ga...@hotmail.com> on 2004/02/14 02:01:45 UTC

changing the dimensions of the root svg element

Is there a way to change the height and width of the root svg element using 
ecmascript?

For example, let's say that I start with width="300" in the svg root 
element. Then I create a text node using ecmascript, append it to the root, 
and determine it's width with getComputedTextLength(). Is there a way for me 
to change the width of the root based on the width of the text (that is, to 
crop the document)?

Thanks.

--David

_________________________________________________________________
Get some great ideas here for your sweetheart on Valentine's Day - and 
beyond. http://special.msn.com/network/celebrateromance.armx


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


Re: changing the dimensions of the root svg element

Posted by Thomas DeWeese <Th...@Kodak.com>.
David Gellman wrote:

> Is there a way to change the height and width of the root svg element 
> using ecmascript?
> 
> For example, let's say that I start with width="300" in the svg root 
> element. Then I create a text node using ecmascript, append it to the 
> root, and determine it's width with getComputedTextLength(). Is there a 
> way for me to change the width of the root based on the width of the 
> text (that is, to crop the document)?

     Have you tried 'setAttribute("width","100")' on the SVG element?

     This doesn't cause the document 'window' to resize but it should
cause the document to be clipped at the new width.


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