问题
I have some content on my page and also have three C3 graphs I am using jsPDF to generate the pdf with graphs.
My code:
$(function() {
$('#download_as_pdf').click(function() {
var pdf = new jsPDF('lanscape');
var options = { pagesplit: true,'background': '#fff' };
pdf.addHTML($('#customer_report_section'), options, function() {
pdf.save("mypdf.pdf");
});
});
});
Now its working fine and pdf is generating but PDF has 5-6 pages they are not breaking properly. Anyone have any idea how can I achieve this?
回答1:
I haven't seen any option that works properly (check this issue on Github: https://github.com/MrRio/jsPDF/issues/944)
There's this package that promises to fix some of the issues, but I haven't tried it yet: https://github.com/MrRio/jsPDF/issues/1176
The last option I see is splitting your content into different pages manually and adding a page after each, sort of like this: https://github.com/MrRio/jsPDF/issues/46#issuecomment-205510431
来源:https://stackoverflow.com/questions/44538408/page-split-is-not-working-in-jspdf