I've got this code that I'm using to export HTML to PDF, and it's functional; however, the CSS is not being applied.
<body>
<div class="container">
<div style="background-color: yellow" id="pagina">Page to Print</div>
<div id="editor">
<a href="#" class="btn btn-primary download-pdf">Download PDF</a>
</div>
</div>
</body>
<script type="text/javascript">
var doc = new jsPDF();
var specialElementHandlers = {
'#editor': function(element, renderer){
return true;
}
};
doc.fromHTML($('body').get(0), 15, 15, {
'width': 170,
'elementHandlers': specialElementHandlers
});
$('.download-pdf').click(function(){
doc.save('demo.pdf');
});
Is there a way to export with CSS included?