I am attempting to convert a specific div to PDF using jsPDF. Below is the structure of the div:
<div id="pdffile" style="display:none" class="containerPDF">
<headerp><h1 id="pdfTitle" style="text-align: center; color:red;"></h1></headerp>
<navp>
<div id="pdfImage"></div>
</navp>
<articlep>
<h1>Description</h1><p id="pdfDescription"></p>
</articlep>
<footerp style="text-align: center;">Copyright © Emoovio</footerp>
</div>
<div id="editor"></div>
Additionally, this is my jQuery code snippet:
$('#cmd').click(function () {
var x = $(".entry-title").text();
doc.fromHTML($('#pdffile').html(), 15, 15, {
'width': 170,
'elementHandlers': specialElementHandlers
});
//doc.autoPrint();
doc.save('emoovio-'+x+'.pdf');
});
However, when I run this code, the resulting PDF lacks any styling such as center alignment or color formatting.