utelle / wxpdfdoc

wxPdfDocument - Generation of PDF documents from wxWidgets applications
http://utelle.github.io/wxpdfdoc/
Other
70 stars 27 forks source link

Top margin not considered for page breaks in tables #90

Closed stkruse closed 10 months ago

stkruse commented 10 months ago

Since header height is the difference between y-position after header and y position before header creation, the top margin is not part of header height. So we need to consider the top margin to detect page breaks in multi page tables.

Please see #89

utelle commented 10 months ago

Since header height is the difference between y-position after header and y position before header creation, the top margin is not part of header height. So we need to consider the top margin to detect page breaks in multi page tables.

I agree that the top margin needs to be taken into account.

However, after checking the code carefully I think this is still not the whole story. It is also necessary to take the table header into account properly, if the table has a header. IMHO this is not the case at the moment, although the code tries to do it, but actually fails or at least can fail.

Please see #89

I think method GetLastRowsOnPage() needs to be reworked. See my comments in your PR.

utelle commented 10 months ago

Thanks for reporting and fixing this bug.

I merged your PR #89 in commit 32dd474eb5ec1029a8a88407fd9e4d8cade1df5a.