I am using SVG to develop a web based interactive mapping system. Users are able to compose maps in a web browser using the Adobe SVG viewer. I want to be able to print them as precisely as possible to scale. The way I am trying to do it is to return the SVG to the server then use FOP to convert it to a PDF.
Obviously it is essential that I can precisely control the size of the SVG viewport in the printed output. The approach we have tried is to use FOP to convert the SVG to a PDF. To do this we embeded the SVG as an inline foreign object in an FO file. We have tried setting setting the width and height of the SVG element in cm and setting the content-width and content-height of the insstream-foreign object to the corresponding values, also in cm. The actual file is shown at the end of this message. According to my calculations the width of the black rectangle that is printed in this way should be 10 cm. However in fact it is approximaely 3.5cm. Is there something that I am doing wrong - or is there another way to achieve my objective of printing an SVG document to a precise scale? <?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" page-height="21cm" page-width="29.7cm" margin-top="1cm" margin-bottom="2cm" margin-left="2.5cm" margin-right="2.5cm"> <fo:region-body margin-top="3cm" margin-bottom="1.5cm"/> <fo:region-before extent="3cm"/> <fo:region-after extent="1.5cm"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="simple"> <fo:flow flow-name="xsl-region-body"> <fo:block space-before.optimum="3pt" space-after.optimum="20pt"> <fo:instream-foreign-object content-width='25cm' content-height='12.5cm'> <svg:svg width='25cm' height='12.5cm' viewbox='0 0 250 125' preserveAspectRatio="xMinYMin meet"> <svg:g id='testGroup' style='stroke:black;fill:none;stroke-width:1'> <svg:rect id='testRect' x='50' y='50' width='100' height='50' style='stroke:black'/> </svg:g> </svg:svg> </fo:instream-foreign-object> </fo:block> </fo:flow> </fo:page-sequence> </fo:root> Regards Paul Pentony TASMIS Project Office Directorate of Training Area Management Corporate Services and Infrastructure Group (02) 6266 3806 (ph) (02) 6266 9999 (fax) CP2-2-174 Regards Paul Pentony --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
