On 16.09.2008 20:17:13 lmhelp wrote:
>
> Hi everyone,
>
> Thank you for reading my post.
> Suppose that I have something like that in a xsl stylesheet:
> =========================================================
> ...
> <fo:block>
> <fo:instream-foreign-object>
> <svg:svg width="4cm" height="4cm">
> <svg:g stroke="#FF0000">
> <line x1="0cm" y1="0cm" x2="4cm" y2="4cm" />
> <line x1="1cm" y1="1cm" x2="5cm" y2="5cm" />
> <line x1="2cm" y1="2cm" x2="6cm" y2="6cm" />
> </svg:g>
> </svg:svg>
> </fo:instream-foreign-object>
> </fo:block>
> ...
> =========================================================
> As you can see, the svg lines are not small enough to fit into the
> 4cm x 4cm square I have defined.
>
> (This is a simple example in which all the elements in the svg group
> are known. Suppose that in the general case they are not).
>
> How could I make the svg group fit into a 4cm x 4cm block?
I think the right way would be not to use "cm" inside the SVG content.
Instead you should define a viewBox="0 0 6 6" on the SVG element. The
thing would then look like this:
<svg:svg width="4cm" height="4cm" viewBox="0 0 6 6">
<svg:g stroke="#FF0000">
<line x1="0" y1="0" x2="4" y2="4" />
<line x1="1" y1="1" x2="5" y2="5" />
<line x1="2" y1="2" x2="6" y2="6" />
</svg:g>
</svg:svg>
Maybe that helps.
> Probably by doing a dilatation (homothety) of the svg group...
>
> I considered using the fo:instream-foreign-object properties:
> content-width="scale-to-fit"
> content-height="scale-to-fit"
> scaling="uniform"
> (or any other one that would be more appropriated of course!)
>
> But:
> - I am not sure that this is at the fo:instream-foreign-object level
> that a transform has to be applied to the svg group. Maybe it has
> to be done at the svg level... I don't know.
> - If the fo:instream-foreign-object properties I mentioned above are the
> right ones to use, can you tell which values would be ok...
>
> I would greatly appreciate your help.
> Thanks in advance.
>
> --
> Lmhelp
> --
> View this message in context:
> http://www.nabble.com/scale-to-fit%2C-svg-group-tp19517624p19517624.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]