I am able to export div content to pdf file but this is done when the content fit on one page. When there are more than one pages in the exported pdf file, all pages are empty. I am wondering how to export div content when pages many. My code is below:
<script type="text/javascript">
var name="END OF YEAR RANKS.pdf";
$("body").on("click", "#btnExport", function () {
html2canvas($('#tblCustomers')[0], {
onrendered: function (canvas) {
var data = canvas.toDataURL();
var docDefinition = {
content: [{
image: data,
width: 500
}]
};
pdfMake.createPdf(docDefinition).download(name);
}
});
});
</script>
This code is working for a div content that will be exported to only one page. When div content will be exported to many pages, how to do it? Help!
Also, how to add page numbers?
<script type="text/javascript">
var name="END OF YEAR RANKS.pdf";
$("body").on("click", "#btnExport", function () {
html2canvas($('#tblCustomers')[0], {
onrendered: function (canvas) {
var data = canvas.toDataURL();
var docDefinition = {
content: [{
image: data,
width: 500
}]
};
pdfMake.createPdf(docDefinition).download(name);
}
});
});
</script>
This code is working for a div content that will be exported to only one page. When div content will be exported to many pages, how to do it? Help!
Also, how to add page numbers?