We have found that we can get a rectangle printed to scale by specifying its
size in cm in the SVG.  For instance the file at the bottom of this message
produces a 10 cm square.

I find this perplexing because, as I understand it, it should not be
necessary to put units any of the internal elements in svg - the size of the
svg viewport should be determined by height and width attributes of the svg
element itself, and the relationship between the svg coordinate system and
display units should be determined by the viewbox and preserveAspectRatio
attributes.  Is there still something we are doing wrong or will we have to
go through our svg and add units in all the appropriate places? ( This will
be a non trivial exercise because we have multiple paths which include
circular arcs).  Any suggestions would be greatly appreciated.

<?xml version="1.0" encoding="utf-8"?> 
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";
xmlns:svg="http://www.w3.org/2000/svg";
xmlns:xlink="http://www.w3.org/1999/xlink";>

  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple">
        <fo:region-body margin="0cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>

  <fo:page-sequence master-reference="simple">

    <fo:flow flow-name="xsl-region-body">

        <fo:block border-color="black" border-style="solid"
border-width="thin">
                <fo:instream-foreign-object width='800' height='400'>
                                <svg:svg width='25cm' height='12.5cm'
viewbox='0 0 800 400' preserveAspectRatio="xMinYMin meet">
                                        <svg:g id='testGroup'
style='stroke:black;fill:none;stroke-width:1'>
                                                <svg:rect id='testRect'
x='1cm' y='1cm' width='10cm' height='10cm' style='stroke:black'/>
                                        </svg:g>
                                </svg:svg>
                        </fo:instream-foreign-object>
        </fo:block>

    </fo:flow> 
  </fo:page-sequence>
</fo:root>

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

Reply via email to