<div id="Contents">
<div style="float:left;margin-left:10px;">
<svg></svg>
</div>
<div style="float:left;margin-left:10px;">
<svg></svg>
</div>
</div>
यह मेरा एचटीएमएल कोड है। मैं इसे कैनवास छवि को कन्वर्ट करना चाहता हूं।एचटीएमएल और एसवीजी कैनवास जावास्क्रिप्ट
html2canvas($("#Contents"), {
onrendered: function(canvas) {
window.open(canvas.toDataURL());
}
});
मैं इसे छवि में बदलने के लिए html2canvas प्लगइन का उपयोग करता हूं लेकिन यह svg नहीं दिखाता है। मैं svg tp कैनवास परिवर्तित हल, लेकिन अब काम नहीं कर रहा html2canvas
var $to=$("#MainContents").clone();
$($to).children(".box").each(function() {
var svg = ResizeArray[$(this).children(".box-content").children().attr("new-id")-1].svg();
var Thiscanvas = document.createElement("canvas");
Thiscanvas.setAttribute("style", "height:" + 100 + "px;width:" + 100+ "px;");
canvg(Thiscanvas, svg);
$(this).append(Thiscanvas);
});
html2canvas($($to), {
onrendered: function(canvasq) {
var w=window.open(canvasq.toDataURL());
w.print();
}
});
मैं कैनवास को svg में बदल सकते हैं, लेकिन html2canvas काम नहीं कर कार्य करते हैं।
[Fabric.js] (http://fabricjs.com) पर कैनवास – kangax
http एसवीजी प्रदान कर सकते हैं: // stackoverflow https://code.google.com/p/canvg/downloads/list
इस प्रयास करें .com/प्रश्न/14165426/can-html2canvas-render-svg-in-a-page – azad