Мне нужно экспортировать HTML-таблицу в pdf файл с помощью jspdf. Я попробовал приведенный ниже код, но он отображает пустой/пустой вывод в pdf файле. Любые предложения или примеры кода для этого были бы полезны. `
<script type="text/javascript">
function demo1() {
$(function () {
var specialElementHandlers = {
'#editor': function (element,renderer) {
return true;
}
};
$('#cmd').click(function () {
var doc = new jsPDF();
doc.fromHTML($('#htmlTableId').html(), 15, 15, {
'width': 170,'elementHandlers': specialElementHandlers
});
doc.save('sample-file.pdf');
});
});
}
</script>
`