Hi,

if you have a svg-root element like you specified (

<svg viewBox="2.145927 -6.520668 1.79657 1.452484" width="100%"
height="100%" ... >

)

, you don't need to replace the width and height to a certain value. No need to pre-process the SVGs. Note that you need a viewBox and need to set the width and height to "100%".

Just use the -w and -h switches of the batik rasterizer as documented at http://xml.apache.org/batik/svgrasterizer.html.

As an example, open the samples/mapSpain.svg file that comes with the batik distribution and edit the width and height attribute to set it to "100%".

Then start the rasterizer as follows:

java -jar batik-rasterizer.jar -w 6000 -h 4200 samples/mapSpain.svg -m image/png -d spain.png -bg 255.255.255.255

and you get a crisp output in png that scales to your given width and height in pixel.

Please note that you need to increase the amount of memory that the batik-rasterizer has at hand if you want to process medium to big file sizes or big raster files as output.

Another option to "scale" your image to a given width and height is to write a wrapper xsl-fo document and include the svg there. That way you can also generate multipage documents.

Hope, this helps,

Andreas



--
----------------------------------------------
Andreas Neumann - Institute of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg
CH-8093  Zurich, Switzerland
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
e-mail: [EMAIL PROTECTED]
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/


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

Reply via email to