yWorks / svg2pdf.js

A javascript-only SVG to PDF conversion utility that runs in the browser. Brought to you by yWorks - the diagramming experts
MIT License
667 stars 104 forks source link

Uncaught DOMException: Failed to execute 'getExtentOfChar' #16

Closed psamim closed 7 years ago

psamim commented 7 years ago

Hi,

I have the following error in my browser console:

Uncaught DOMException: Failed to execute 'getExtentOfChar' on 'SVGTextContentElement': The charnum provided (0) is greater than or equal to the maximum bound (0).
    at file:///home/samim/workspace/svg/bundle.js:493:17744
    at d (file:///home/samim/workspace/svg/bundle.js:493:6223)
    at j (file:///home/samim/workspace/svg/bundle.js:493:17661)
    at U (file:///home/samim/workspace/svg/bundle.js:493:21556)
    at file:///home/samim/workspace/svg/bundle.js:493:18144
    at d (file:///home/samim/workspace/svg/bundle.js:493:6223)
    at z (file:///home/samim/workspace/svg/bundle.js:493:18126)
    at U (file:///home/samim/workspace/svg/bundle.js:493:21249)
    at file:///home/samim/workspace/svg/bundle.js:493:18144
    at d (file:///home/samim/workspace/svg/bundle.js:493:6223)

I also have uploaded the files to the following repo:

https://github.com/psamim/svg2pdf.js-test

(npm install , ./node_modules/.bin/webpack ./entry.js bundle.js, then open index.html)

Thanks, Samim

yGuy commented 7 years ago

Please check whether this commit (and the version upgrade) fixes the issue for you: https://github.com/yWorks/svg2pdf.js/commit/22e727b969fc89ab645ef96972677ce7b7d0844c

psamim commented 7 years ago

Yes, it seems that it solved the issue. Thanks! :)