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

Unwanted margin in multi-page table #583

Closed
morloy opened this issue Mar 6, 2018 · 4 comments
Closed

Unwanted margin in multi-page table #583

morloy opened this issue Mar 6, 2018 · 4 comments
Labels
bug Existing features not working as expected
Milestone

Comments

@morloy
Copy link

morloy commented Mar 6, 2018

We discovered a very strange margin issue in a table that spans over two pages.
As you can see in the image, one single number has a margin to the right. The HTML code for all rows is exactly the same. So I'm a bit confused about how to trace this bug. Maybe some of the experts can give a hint?
image

Here's the source HTML and the produced PDF from WeasyPrint.
report.zip

@Tontyna
Copy link
Contributor

Tontyna commented Mar 21, 2018

Can reproduce the error and it's - - - STRANGE!
There seem to be magic numbers involved. Don't get it. Yet.

Stupid workaround at the moment:
Alter your @page's top margin. Either reduce it to 2.8cm or less. Or increase it to 3.2cm or more.

/* report.html, line 12433 ff */
    @page {
      size: A4;
      margin: 3cm 2cm; 
      /* margin-top between 2.9 and 3.1 produces the strange error */
      margin-top: 2.8cm;
      @bottom-right {
        font-family: 'Montserrat';
        content: "Page " counter(page) " of " counter(pages);
      }
    }

As I said: strange magic numbers. I keep at it and will report my findings.

liZe added a commit that referenced this issue Mar 22, 2018
liZe added a commit that referenced this issue Mar 22, 2018
@liZe liZe closed this as completed in 08df76c Mar 22, 2018
@liZe liZe added this to the 43 milestone Mar 22, 2018
@liZe
Copy link
Member

liZe commented Mar 22, 2018

What a dirty bug!

@morloy It's also the first real-life problem I get with flexbox, as I had to fix an endless loop before fixing this bug. I'd be really interested by some tests with your documents (as bootstrap includes some flexbox layout). If you can test the current master branch, it may avoid bad surprises when next version is released!

There seem to be magic numbers involved.

@Tontyna Thanks for the hint!

@liZe liZe added the bug Existing features not working as expected label Mar 22, 2018
@morloy
Copy link
Author

morloy commented Mar 22, 2018

@liZe Cool, current master works with the sample document. Thanks a lot!
When will the fix be available in pip?

@liZe
Copy link
Member

liZe commented Mar 22, 2018

Cool, current master works with the sample document. Thanks a lot!

Yes, now that the bug is fixed 😉. It would be a good idea to test other (if any) documents you're generating too, as flexbox support may have broken /changed them.

When will the fix be available in pip?

I'll release another 0.42.x version before the end of the month.

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

3 participants