convert svg2png on windows

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
marcusx

convert svg2png on windows

Post by marcusx »

Hi everyone!

I am absolutly new to IM and whant to convert a svg file to an png or jpg but I get this error:
Non-conforming drawing primitive definition `1.'

Code: Select all

convert -size 100x100 text.svg test.png
Does this mean that the svg file is not valid? Will I have to install some additional modules? I found something that this is neccesarry but there are only some linux sources. Will I need somthing additional for the windows version, too?
Thanks for your help!

regards marcus
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert svg2png on windows

Post by fmw42 »

I am no expert on the use of SVG, but I think its file should have a definition within it to say how big to make the image. So remove the -size 100x100 as that usually needs to be followed by xc:"some color"

convert text.svg test.png
marcusx

Re: convert svg2png on windows

Post by marcusx »

that was my first try, but I got a message that I have to provide a size
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert svg2png on windows

Post by anthony »

Without seeing the offending SVG image is it imposible to say what is the problem.

There was a probelm with SVG dicivered recently in that some SVG were not parsed correctly in determining the output width and height. Those values is specified in an initial <svg ...> tag in the SVG image. The new IM point release just release will have that problem fixed, if it is that problem.

Note that there are two SVG convertsion methods available. The built-in (and incomplete) MSVG method, and the RSVG whcih calls an external RSVG library to render the SVG image as a raster. Most likely you are using the former.

You can find out by checking the output of

Code: Select all

convert -list configure
and looking for rsvg on the "DELEGATES" line.

For more information see http://www.imagemagick.org/Usage/draw/#svg
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply