Html2canvas: SVG image tag not work

Created on 11 Jun 2015  ·  6Comments  ·  Source: niklasvh/html2canvas

Sorry, I am not good at english

Hi

I'm trying to capture SVG tag.

http://jsfiddle.net/geekduck/bgzydk8v/2/

I can capture SVG rect and circle tag but SVG image tag.

I use useCORS and I can capture img tag.

Is there any ideas for SVG image tag?

Thanks.

Bug

All 6 comments

+1 for getting this fix merged, I am having the same issues.

Interesting find - if I present the image's base64 encoded data in the xlink:href attribute of the image, the image appears in the html2canvas-generated canvas. If I provide html2canvas a relative path to the image, it does not work. e.g.
<image id="OpenLayers_Geometry_Point_42754" cx="690.6698311208747" cy="286.4667614893988" r="1" preserveAspectRatio="none" x="683" y="278" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABd0lEQVQ4T62Tv0sCYRzGP2eiZdxBST82iYLADGoILmirucmhOaSkoTEsaJGCiJYIJIr6EwKn6A8IrUGi0q2IhshIh7u0FPXiNcXSLjJ6x+/zPp/v8xzvSXx/FMANjFTkCyAO6PXXpQZ/B8solllkqRvV2lrWo4U3XowkeumQFBufPV8BXdI5XvsgIVkkaDx+TSOcT/BojFfFGkCY19rHmGszaVUZh14hmDkjaahi8gEQsWdaA6ab65FzmsZRbp0UmwKg4LLEuHP2/7y6TnU933JvDAuAiqflhKvO73ubUT1pnXhxSgD8+Ozb7Cu2phL4tDwHucV/AfytwlBaJ1GcFAlk+iwxbp0DTVVwpW64L5U/IjgJ4LWvsKvIv4L4NJ1wLsgzW7WH1CtFWHWoLDh+ZuxkYSN7yoMxUXtIVUuPFGXa5mbPJInYfJy/rJobAR91lmiX5pEtXahWe5kdKeTIGE9kSrsitvnPVFNEDw8wWhnFgGvgtb7fO2wpc13ikHF4AAAAAElFTkSuQmCC" style="opacity: 1" fill="#000000" fill-opacity="1" stroke="#000000" stroke-opacity="1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></image>
works while
<image id="OpenLayers_Geometry_Point_42880" cx="124.9999999916181" cy="79.99999999953434" r="1" preserveAspectRatio="none" x="112" y="67" width="25" height="25" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/path/to/image/on/server/image.png" style="opacity: 1" fill="#000000" fill-opacity="1" stroke="#000000" stroke-opacity="1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></image>
does not.

+1,i am having the same issues.i hope who can solve it

+1, i am having the same issues. it seems not solved in latest version. why not #998 not merged in latest version?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Josh10101010 picture Josh10101010  ·  3Comments

dking3876 picture dking3876  ·  4Comments

tjchambers32 picture tjchambers32  ·  3Comments

stevencherry1 picture stevencherry1  ·  3Comments

kunal886496 picture kunal886496  ·  3Comments