Jspdf-autotable: v2.3.4 - Page break - empty row on ends of some pages

Created on 18 Jul 2018  路  13Comments  路  Source: simonbengtsson/jsPDF-AutoTable

I'm having an issue where empty rows are being added at the ends of certain pages. I noticed this is because the printFullRow function does check whether the row can fit on the page, but it still calls printRow even if there is no space left on the page.

I attached a screenshot of the Chrome devtools showing this problem. I am running this module using Node.js, however I experienced the same issue in browser.

Simply skipping the printRow call if remainingLineCount <= 0 should fix this problem, as far as I can tell.

printfullrow
empty row

bug

Most helpful comment

It is not solved yet in v3. I think there should be an option to skip incomplete row from previous page and start it from next page.

All 13 comments

Jsfiddle posted in #362 https://jsfiddle.net/bcnwnucj/ highlighting the issue.

Existis a solution to this problem , I need

Try the v3 alpha!

How I do It ?

Npm install lastet version jspdf?

I try this version but happened many problems, some dependencies are necessary how my project is ng2 this problems not is possible to refresh, because is a project very big and can affect others functionality. Have a suggestion ?

Which dependency was the problem? Angular 2+? What is the error? If you create a new issue with some code that I can replicate it with I'll take a look.

So, this project is very big, the dependencies that occur problem was commom , forms, core ,eslint-plugin-jsx-a11y and more

Try and see if this is solved in v3

It is not solved yet in v3. I think there should be an option to skip incomplete row from previous page and start it from next page.

I also encountered the same issue in version 3.0.13, where I think the issue is when there is an incomplete row from previous page.. the next row will have problem in the computation of cell height.

as seen here in the image below:
1

the first row in the second page is being cut because of the incomplete row previous page. Please let us know..how you go on this..

I have the same issue when the last row on page has very long content and extend it to the next page, on the next page it will cutoff some content, I think maybe cell height calculation in this case might have some issue, is there any workaround for this scenario?

Hi, I am having this issue still
image
My code for creating the PDF looks as follows:
$j( "#export" ).click(function() {
$j.each(ultraChartData, function(index, value) {
var doc = new jsPDF();
var headers = value[0];
value.shift();

    doc.autoTable({
    head: [headers],
    body: value,

    styles: {
        cellPadding: 10,
    },
    columnStyles: {
        0: {cellWidth: 30},
        1: {cellWidth: 80}}
    });
  doc.save('table.pdf');
  });

});

It is supposed to be printing multiple pdfs

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alorse picture Alorse  路  4Comments

andrico1234 picture andrico1234  路  5Comments

mmghv picture mmghv  路  4Comments

cwolcott picture cwolcott  路  4Comments

JoakFlores picture JoakFlores  路  3Comments