On Wednesday 03 January 2007 12:59, [EMAIL PROTECTED] wrote:
> > > Sean Wheller <[EMAIL PROTECTED]> wrote on 01/02/2007 06:52:56 AM:
>  > >  > It seems that setting the canvas size smaller is not the solution.
>  > >  > Batik still renders an image with a huge amount of wasted space.
> >
> > On Tuesday 02 January 2007 14:49, [EMAIL PROTECTED] wrote:
>  > > What you probably want to have is a viewBox as well as a width
>  > > and height.   Something like:
>  > > <svg
>  > >     width="452.64005pt"
>  > >     height="320.53pt"
>  > >     viewBox="0 0 452.64 320.53"
>  > >     [... the rest of the attrs ...]
>
> Sean Wheller <[EMAIL PROTECTED]> wrote on 01/02/2007 08:20:40 AM:
>  > I am aware of the view box option and it does work when passed at the
>  > command line. [...]
>  >
>  > Surely, there must be a way of doing this in an automated fashion. The
>  > whole documentation system is docbook, built using ant so I guess it can
>  > be done.
>  >
>  > How can I use the getBBox you mentioned in earlier post?
>
>    Well if you can add an 'onload' event handler to the root SVG element
> (might be possible in docbook using a stylsheet) it is pretty simple
> (note that this is using Java from Javascript to print the result):
>
>         onload="System.err.println('BBox: ' +
> document.getRootElement().getBBox())"

I see. Tried this on one file, but then I face the issue of having to add this 
to all SVG files as they hit SVN or the nightly build will not work and I 
don't think the engineers will remember to add it. So I must find a solution 
that purely requires an SVG file as created by Inkscape.

>
>    Getting it in Java is roughly the same but you need to do some casting
> in some places.  If you can add the Javascript onload event attribute then
> the onload script can add the viewBox attribute at that point and it will
> be respected during transcoding.
>
>    To do it in Java however you will probably need to modify the
> SVGAbstractTranscoder (the preserveAspectRatio transform calculation
> starts at around line 240).
>
>    I might look into adding an 'auto-aoi' command line option.

Will take a look.

I am also looking into extracting the required values and passing them to ant 
properties using xpath and Andariel Ant Tasks [http://andariel.uworks.net/]. 
If this solution works, then I should be able to create a foreach loop with 
ant-contrib, get values of SVG element attributes, pass them back as Andariel 
properties to populate the java command arguments.

-- 
Sean Wheller
Technical Author
email: [EMAIL PROTECTED]
im: [EMAIL PROTECTED]
skype: seanwhe
cel: +27-84-854-9408
web: http://www.inwords.co.za

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to