Inkscape.org
Beyond the Basics Can no longer save from svg Inkscape to HTML Canvas
  1. #1
    stefan_claudiu stefan_claudiu @stefan_claudiu
    *

    I can no longer save my file, svg to HTML Canvas. I receive this error message:

    Traceback (most recent call last):
      File "C:\Program Files\Inkscape\share\inkscape\extensions\ink2canvas.py", line 99, in <module>
        Html5Canvas().run()
      File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 231, in run
        self.save_raw(self.effect())
      File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 277, in save_raw
        self.save(self.options.output)
      File "C:\Program Files\Inkscape\share\inkscape\extensions\ink2canvas.py", line 37, in save
        self.walk_tree(svg_root, canvas)
      File "C:\Program Files\Inkscape\share\inkscape\extensions\ink2canvas.py", line 94, in walk_tree
        self.walk_tree(node, canvas)
      File "C:\Program Files\Inkscape\share\inkscape\extensions\ink2canvas.py", line 89, in walk_tree
        elem.draw()
      File "C:\Program Files\Inkscape\share\inkscape\extensions\ink2canvas_lib\svg.py", line 249, in draw
        self.set_style(style)
      File "C:\Program Files\Inkscape\share\inkscape\extensions\ink2canvas_lib\svg.py", line 99, in set_style
        getattr(self.ctx, method)(style[key])
      File "C:\Program Files\Inkscape\share\inkscape\extensions\ink2canvas_lib\canvas.py", line 121, in set_stroke
        self.write("ctx.strokeStyle = %s;" % self.get_color(value, alpha))
      File "C:\Program Files\Inkscape\share\inkscape\extensions\ink2canvas_lib\canvas.py", line 96, in get_color
        return "'{}'".format(str(Color(rgb).to_rgba(alpha)))
      File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\colors.py", line 248, in __init__
        space, color = self.parse_str(color.strip())
      File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\colors.py", line 325, in parse_str
        raise ColorIdError("Color references other element id, e.g. a gradient")
    inkex.colors.ColorIdError: 'Color references other element id, e.g. a gradient'

    In Swedish it says that "Inkscape has received additional data from the script that was run. The script didn't return any errors but this can give unexpected results." The following thread gives no solutions: https://inkscape.org/pt/forums/questions/error-when-using-extensions/

  2. #2
    Maren Hachmann Maren Hachmann @Moini

    Please report bugs at https://inkscape.org/report (and make sure that you're using the latest version, too). And perhaps try if it works without swatches or gradients to narrow down the problem.

  3. #3
    Adam Belis Adam Belis @AdamBelis

    FIY    extetion is broken only if you trie export gradeints

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Can no longer save from svg Inkscape to HTML Canvas