Hello Annick,

Here is how things work.

If you have the following image:

(myImage.svg)
<svg width="4.5in" height="5in" viewBox="0 0 450 500">
...
</svg>

and you want to rasterizer this, you have several options.

a. Modifying the resolution.

If you set the -dpi option, you change the convertion ratio from in to user space units (px) which will yield an image with 'more pixels'. For example:

svgrasterizer -dpi 300 -m image/tiff myImage.svg

will create a 300 dpi TIFF image.

b. Modifying the size of the image

If you set the -w (and or -h) options, you change the size of the viewport into which the image is drawn. So, for example, if you set w to 450, your image will now be 450 pixels wide.

svgrasterizer -w 450 myImage.svg

will produce a PNG image (the default) which is 450x500.

I hope this clarifies the parameters. Note that -w and -h are unitless and correspond to pixel values.

Vincent.

Annick Fron wrote:
Hello,

Are height and width expressed in pixels, dots , mm or inches ?
My experience is that rasterizing a svg expressed in cm does not work,
expressed in pixels works, but I can' t control the size.

I read somewhere that FOP actual implementation was limited to 72 dpi (to be
fixed).
It seems also that the pixelsToMm options which is documented in the source
is not available externally and would, I guess, allow to express the svg
size in mm.


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

Reply via email to