I have an div container which contains a span tag inside id there is svg tag element and have to convert it to pdf. i have tried using html2canvas.js. i need to print the area with borders. please check with the jsfiddle link. once i converted to image and using jspdf library will convert to pdf SVg image is not rendering after using canvg library and html2canvas
https://jsfiddle.net/6pupxnca/5/
jQuery(document).on('click','#getpdf',function(){
//console.log("canvas");
html2canvas(jQuery('#view-front'),
{
background: '#fff',
allowTaint: true,
//console.log("adsfasdf");
onrendered: function (canvas) {
var a = document.createElement('a');
// toDataURL defaults to png, so we need to request a jpeg, then convert for file download.
a.href = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
console.log(a.href);
a.download = 'somefilename.png';
a.click();
}
});
});