How do I save this DIV, with css formatting, if it's easier to do with table, so can I, so what I need is to just show this DIV with value inside.
It will be generated side by side.
var doc = new jsPDF();
var specialElementHandlers = {
'#editor': function (element, renderer) {
return true;
}
};
$('#btGerarPDF').click(function () {
doc.fromHTML($('#etiqueta').html(), 0, 0, {
'width': 170,
'elementHandlers': specialElementHandlers
});
doc.save('teste.pdf');
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.4/jspdf.debug.js"></script><divid="etiqueta" style="width: 89mm; height: 36mm; border: 1px solid black; font-size: 3em; text-align: center; float:left; margin-right: 10px">
<div style="padding-top: 33px;">102030</div>
</div>
<div id="etiqueta" style="width: 89mm; height: 36mm; border: 1px solid black; font-size: 3em; text-align: center; float:left; margin-right: 10px">
<div style="padding-top: 33px;">102030</div>
</div>
<div id="editor"></div>
<button id="btGerarPDF">gerar PDF</button>