如何将HTML页面中的表导出为PDF.我已经做了一些样本数据,但是我无法将HTML表格列表加载到PDF中,请帮助我将表格加载到PDF中.
html2canvas example$(document).ready(function() {
var specialElementHandlers = {
'#editor': function(element, renderer) { return true; }
};
$('#cmd').click(function() {
var doc = new jsPDF();
doc.fromHTML($('#target').html(), 15, 15, {
'width': 170,'elementHandlers': specialElementHandlers
});
doc.save('sample-file.pdf');
});
});
Hello, this is a H3 tag
this is bold red
Header 1 | Header 2 |
---|---|
row 1, cell 1 | row 1, cell 2 |
row 2, cell 1 | row 2, cell 2 |
generate PDF