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

Missing text #979

Closed
takis opened this issue Oct 25, 2019 · 2 comments
Closed

Missing text #979

takis opened this issue Oct 25, 2019 · 2 comments
Labels
bug Existing features not working as expected
Milestone

Comments

@takis
Copy link

takis commented Oct 25, 2019

I have a specific PDF page which misses text when being rendered with WeasyPrint.

I took the original HTML and CSS and removed code to get a smaller and simpler example illustrating the problem. I tried adding the boxes together to further simplify the example, but doing so resulted in the correct behavior of spilling over the contents to the next page.

<!DOCTYPE html>
<html>
  <head>
    <style>
      @page {
        margin: 5mm;
      }
      #boxa {
        height: 25mm;
      }
      #boxb {
        height: 35mm;
      }
      #boxc {
        height: 65mm;
      }
      #boxd {
        height: 35mm;
      }
      #boxe {
        height: 30mm;
      }
      #boxf {
        height: 10mm;
      }
      #boxg {
        height: 45mm;
      }
      .group {
        border: 1pt solid red;
        padding: 2mm;
      }
      td {
        padding-top: 1mm;
      }
    </style>
  </head>
  <body>
    <div>
      <div id="boxa" class="group"></div>
      <div id="boxb" class="group"></div>
      <div id="boxc" class="group"></div>
      <div id="boxd" class="group"></div>
      <div id="boxe" class="group"></div>
      <div id="boxf" class="group"></div>
      <div id="boxg" class="group"></div>
      <div id="boxh" class="group">
        <table>
          <tbody></tbody>
          <tfoot>
            <tr>
              <th>missing</th>
              <td>missing</td>
            </tr>
          </tfoot>
        </table>
      </div>
    </div>
  </body>
</html>

The output of WeasyPrint:
Screenshot 2019-10-25 18:17:13

@Tontyna
Copy link
Contributor

Tontyna commented Oct 26, 2019

Probably duplicate of #978

@Tontyna
Copy link
Contributor

Tontyna commented Oct 26, 2019

Naa, not exactly a duplicate. Though both issues stem from the fact that WeasyPrint tries to avoid orphaned table headers and widowed table footers.

In the above example table_layout detects that the table footer is too big to fit on the remaining space. But since there is nothing in the table's body the footer looks like a widow and is suppressed.

No decision is made between "there is nothing left" and "there never has been anything" in the table body.

@liZe liZe added the bug Existing features not working as expected label Nov 7, 2019
@liZe liZe modified the milestone: 51 Dec 18, 2019
@grewn0uille grewn0uille added this to the 51 milestone Dec 20, 2019
@liZe liZe closed this as completed Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

4 participants