I am drawing the text in SVG on an image based on user input in text box.
I want to capture both image and text of SVG to canvas so that
i can convert it to base 64 string after showing it on canvas. I am able to
capture the text in canvas but image is not showing.
<body>
<svg id="svgelem" class="scaling-svg" xmlns="http://www.w3.org/2000/svg">
<g>
<image xlink:href="http://i.imgur.com/PWSOy.jpg" x="0" y="0" height="200" width="200" />
<text x="38%" y="68%" alignment-baseline="middle" text-anchor="middle" font-family="Calibri" font-size="25" id="textbox" fill="black"></text>
</g>
</svg>
<input type="text" name="name" id="name" maxlength="26" />
<input type="submit" id="drawText" value="Draw It" />
<div style="clear:both;"></div>
<br/>
<canvas id="canvas" style="border:2px solid black;" width="250" height="250">
</canvas>
</body>
Have a look at jsfiddle
Here's a link
https://jsfiddle.net/atulpr/0yhpygue/14/