Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG image tag not work #602

Closed
geekduck opened this issue Jun 11, 2015 · 8 comments · May be fixed by #998
Closed

SVG image tag not work #602

geekduck opened this issue Jun 11, 2015 · 8 comments · May be fixed by #998
Labels

Comments

@geekduck
Copy link

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.

@brcontainer
Copy link
Contributor

Duplicate from #95 ?

@niklasvh
Copy link
Owner

@niklasvh niklasvh added the Bug label Dec 12, 2017
@npmuller
Copy link

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

@npmuller
Copy link

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.

@dengma0
Copy link

dengma0 commented May 11, 2018

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

@sumile-ting
Copy link

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

@jlichti
Copy link

jlichti commented Jun 5, 2021

Same issue here

@pdemidyuk-ib
Copy link

pdemidyuk-ib commented Jul 20, 2023

Suggestion from @npmuller works fine, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants