Inkscape.org
Beginners' Questions SVG Files Issue
  1. #1
    murtaza.mushtaq murtaza.mushtaq @murtaza.mushtaq

    Hey,

    I had a bunch of SVG files in version 1.0 and was wondering if it would be possible to use the Inkscape command line to convert the versions of these files to 1.1? I know you could convert .svg to .pdf, .png, etc.

  2. #2
    Maren Hachmann Maren Hachmann @Moiniβš–

    Do I understand correctly that you are intending to convert files that use SVG 1.0 to SVG 1.1? Why?

     

    Citing Wikipedia:

    "SVG 1.1 became a W3C Recommendation on 14 January 2003.[18] The SVG 1.1 specification is modularized in order to allow subsets to be defined as profiles. Apart from this, there is very little difference between SVG 1.1 and SVG 1.0. "

  3. #3
    murtaza.mushtaq murtaza.mushtaq @murtaza.mushtaq

    One of the tools that I use at work doesn't seem to parse files using SVG 1.0. But when SVG 1.1 files are used, there seems to be no error.

    I could manually change the versions by opening and saving them using Illustrator, however, the quantity of the files using SVG 1.0 is HUGE.

  4. #4
    Maren Hachmann Maren Hachmann @Moiniβš–

    Can you try if replacing the version number only in the file (use a text editor) will already make the tool accept the file?

  5. #5
    murtaza.mushtaq murtaza.mushtaq @murtaza.mushtaq

    It turns out that the version is not the issue since I found a file that is parsed even though the file uses version 1.0. 

  6. #6
    Maren Hachmann Maren Hachmann @Moiniβš–

    Can you see what's different between the file that works and the ones that don't?

    The usual suspects are clones, clips, masks, text and filters.

  7. #7
    murtaza.mushtaq murtaza.mushtaq @murtaza.mushtaq

    This is the error message I receive for the files that don't work: "prefix inkscape not defined"

  8. #8
    Maren Hachmann Maren Hachmann @Moiniβš–

    Try saving as 'optimized SVG' or as 'Plain SVG' to remove the Inkscape-specific attributes. Your application does not conform to the SVG standard (which is: ignore things you don't understand).  (command line option: -l, --export-plain-svg=FILENAME , for 0.92.4)

  9. #9
    brynn brynn @brynn

    There was an unrelated message posted here (non-English, about printing), which has been moved to its own topic:  https://inkscape.org/forums/questions/need-help-with-printing/

  10. #10
    Kresimir Kresimir @kresimir235

    I recently discovered a very useful little CLI tool called `svgcleaner`:

    https://github.com/RazrFalcon/SVGCleaner

    I'm somewhat confident that it would solve this issue. It is a good idea to backup all the SVG files this tool is used on, because even though it does not change how the SVG file displays, it may destroy some layer information and things like that. I found no issues thus far, but I've been using it for only couple of days.