Update canvas2svg.js

Added Helper function.
Fix
Merge branch 'fix'