i'm trying to print a div into PDF, but i would include CSS into PDF. I've tried many codes of threads but without solution. JsPDF works but the problem is when i include canvas for css. Can u help me?
<button id="pdf">Click</button>
<div id="elem">
<span>test</span>
</div>
<div id="editor">
</span>DON'T PRINT</span>
</div>
<script>
var doc = new jsPDF();
var specialElementHandlers = {
'#editor': function (element, renderer) {
return true;
}
};
$('#pdf').click(function () {
var source = window.document.getElementById("elem");
doc.fromHTML(source, 15, 15,
{
'elementHandlers': specialElementHandlers
});
doc.output("dataurlnewwindow");
});
</script>
this is my code now, but it doesn't include css