CairoSVG icon indicating copy to clipboard operation
CairoSVG copied to clipboard

How to change size and aspect ratio

Open oracle1987 opened this issue 4 years ago • 1 comments

Hi I am trying to change size using svg2svg I'm specifying input path, output path, output height and output width. However the conversion is keeping the aspect ratio constant hence explicitly defined dimension are not met to the exact value.

Is there a work around this or a method to change aspect ratio of svg image? Thanks

oracle1987 avatar Dec 23 '21 14:12 oracle1987

Hello!

If you want to change the way the ratio is handled, you have to change the value of the preserveAspectRatio attribute. You can set this attribute to none on the svg tag if you don’t want to keep the ratio.

liZe avatar Dec 27 '21 10:12 liZe