-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
page break in between text line while convert html to pdf #692
Comments
I've solved with this code: `var body = document.body
I can't paste my code here so... -> https://pastebin.com/qNJrBPGn |
Hii @ikaroweb Thanks for your response do you have any solution or any temporary way regarding this ? |
Try to add more margin on bottom |
but why? |
@eKoopmans
Hii sir,
i am facing an issue in the html2pdf.js
when i convert my section into pdf through the html2pdf then it break the page in between text please see the screen shot below
and this is my html2pdf configuration
code :-
function exportToPDF() {
var element = document.getElementById('invoice');
var opt = {
// margin: [0.3, 0.3, 0.3, 0.3],
mode: ['legacy'], margin: [0.2, 0.1, 0.6, 0.2],
filename: 'Audit-Report.pdf',
enableLinks: false,
// pagebreak: {
// avoid: '.no-split',
// mode: ['avoid-all', 'css', 'legacy']
// },
pagebreak: {mode: 'css', after: '.section_wise_div'},
image: {
type: 'jpeg',
quality: 1
},
html2canvas: {
scale: 4
},
jsPDF: {
unit: 'in',
format: [7.5, 12], ////'a4',
orientation: 'landscape'
}
};
html2pdf().from(element).set(opt).toPdf().get('pdf').then(function(pdf) {
var totalPages = pdf.internal.getNumberOfPages();
for (i = 1; i <= totalPages; i++) {
pdf.setPage(i);
pdf.addImage("http://localhost/glocoach_dev/new_glocoach/images/analytical_report_images/report_footer.png", "PNG", 0, pdf.internal.pageSize.getHeight() - 0.49, 12.2, 0); //second last is width and third last is height
}
}).save();
}
so do you have any solution regarding this ?
The text was updated successfully, but these errors were encountered: