Update canvas2svg.js

Added Helper function.