How to save svg canvas to local filesystem

前端 未结 16 1437
南旧
南旧 2020-11-27 10:10

Is there a way to allow a user, after he has created a vector graph on a javascript svg canvas using a browser, to download this file to their local filesystem?

SVG

16条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 10:23

    I recently found this Chrome plugin http://nytimes.github.io/svg-crowbar/. It's a bit buggy for my needs but essentially works.

    I had previously made a solution similar to the accepted answer which involved a serverside script but it's quite long winded and also had the problem that all the styles had to be inline in the markup. Crowbar seems to take care of that for you, which is nice.

提交回复
热议问题