xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Gellman" <gampyd...@hotmail.com>
Subject Re: changing the dimensions of the root svg element
Date Sun, 15 Feb 2004 02:10:14 GMT
Yes, Thomas, I did try that already (I should have mentioned that in my 
original message). And I've tried assigning a new viewBox to the root 
element, too. These have some of the desired effect, but when I rasterize 
the file using batik-rasterizer the resulting image retains the pixel 
dimensions of the original svg element statement.

I'd like to start with a canvas that's too large, then dynamically render 
content with scripted elements, and then "crop" the result (also in the 
script) so that the final, rasterized file is only the size of the 
dynamically-rendered elements.

Thanks, though, for the suggestion. I think it's the right idea in theory, 
but that in practice it won't control the final result the way I need.

--David


>From: Thomas DeWeese <Thomas.DeWeese@Kodak.com>
>Reply-To: "Batik Users" <batik-users@xml.apache.org>
>To: Batik Users <batik-users@xml.apache.org>
>Subject: Re: changing the dimensions of the root svg element
>Date: Sat, 14 Feb 2004 11:14:56 -0500
>
>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
>

_________________________________________________________________
Keep up with high-tech trends here at "Hook'd on Technology." 
http://special.msn.com/msnbc/hookedontech.armx


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


Mime
View raw message