You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a document with a table where the first row contains a cell with vertical span.
Taylor the document in such a way that the cell with vertical span does not fit between the current rendering position on a page and the bottom margin.
Render the document.
Expected Result
The table should be drawn from the top of a new page.
the table's first row is split. The cell with the vertical spacing is rendered on the page where it does not fit and the rest of the row is rendered on the next page without regard to the top margin. Note that the second table in the example docs renders ok in both cases since the complete vertical span cell fit within the remaining vertical space on that page.
def initial_row_on_initial_page
# we're at the top of our bounds
return 0 if fits_on_page?(@pdf.bounds.height)
needed_height = row(0..number_of_header_rows).height
needed_height is calculated without consideration to vertical span.
Proposed fix:
Change the above to:
def initial_row_on_initial_page
# we're at the top of our bounds
return 0 if fits_on_page?(@pdf.bounds.height)
needed_height = row(0..number_of_header_rows).height_with_span
to account for vertical span.
Both of the above pdf's were rendered via asciidoctor-pdf from the same asciidoc source, one with, one without the fix above. The reason I used asciidoctor-pdf is that I don't have any experience of working directly with prawn-pdf so this was the quickest way for me to render the example docs.
I managed to create a pull request with the above fix (I hope...)
Cheers
/Anders
The text was updated successfully, but these errors were encountered:
Steps-to-reproduce
Expected Result
ok.pdf
Actual Result
error.pdf
Probable cause
In file Table.rb, the following code exists
needed_height is calculated without consideration to vertical span.
Proposed fix:
Change the above to:
to account for vertical span.
Both of the above pdf's were rendered via asciidoctor-pdf from the same asciidoc source, one with, one without the fix above. The reason I used asciidoctor-pdf is that I don't have any experience of working directly with prawn-pdf so this was the quickest way for me to render the example docs.
I managed to create a pull request with the above fix (I hope...)
Cheers
/Anders
The text was updated successfully, but these errors were encountered: