Skip to content
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

Incorrect bottom height calculation in table cell #258

Closed
rammetzger opened this issue Sep 16, 2019 · 4 comments
Closed

Incorrect bottom height calculation in table cell #258

rammetzger opened this issue Sep 16, 2019 · 4 comments

Comments

@rammetzger
Copy link

For long texts (more than one page) within a table cell, it can happen that a line is printed twice. One time on the last page and one time on the next. The cause is an incorrect calculation of the available cell height.

The bug is in the calculation of cell height in class PdfPRow on lines 609-612:

float bottom = cell.getTop() + cell.getEffectivePaddingBottom() - newHeight;
float top = cell.getTop() - cell.getEffectivePaddingTop();

The bottom value does not consider EffectivePaddingTop. The code should look something like this:

float top = cell.getTop() - cell.getEffectivePaddingTop();
float bottom = top + cell.getEffectivePaddingBottom() - newHeight;

Please take over the correction in one of the next versions.
Thanks in advance.

@andreasrosdal
Copy link
Contributor

@PalAditya
Copy link
Contributor

Added a PR (#260) to help out with this 😁

andreasrosdal added a commit that referenced this issue Sep 16, 2019
@andreasrosdal
Copy link
Contributor

@rammetzger Can you please verify that this has been fixed in the master branch?

@rammetzger
Copy link
Author

rammetzger commented Sep 17, 2019 via email

albfernandez added a commit to albfernandez/OpenPDF that referenced this issue Oct 13, 2019
@asturio asturio changed the title Incorrect buttom height calculation in table cell Incorrect bottom height calculation in table cell Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants