WeasyPrint icon indicating copy to clipboard operation
WeasyPrint copied to clipboard

Wrong layout around break of page

Open ildarworld opened this issue 1 year ago • 2 comments

Hello there,

im seeing issue when printing page with table layout around page break. All required data for reproducing is attached. (just need to place static data somewhere and change references in HTML file)

It is working fine in version 53.4 but any more higher version has same behaviour.

image

data.zip

ildarworld avatar Jan 19 '24 09:01 ildarworld

Hi!

Thanks for the report.

There are actually 2 different problems.

First problem

Bottom images don’t appear at the bottom of the first page because we fixed #36. Your "item"s reach the bottom of the page (before rotation, that doesn’t affect the layout), so they are displayed on the next page. As they are absolutely positioned, they overlap the first row of the next page.

It’s easier to understand what happens when removing the rotation and overflow: hidden on td:

Capture d’écran du 2024-01-27 10-30-51

The bottom images (EAC and other logos) are below the page bottom, so they’re displayed on the next page.

You can "fix" this problem with something like

.bottom-images {
  margin-top: -20mm;
  transform: translateY(20mm);
}

You’ll then get the images back at the bottom of the first page.

Second problem

Items are displayed twice at the top of the second page. There’s probably a bug in WeasyPrint causing this problem, we have to investigate.

It may be caused by td’s overflow: hidden. Removing it seems to fix the problem (you can try to use it as a workaround until the bug is fixed.)

liZe avatar Jan 27 '24 09:01 liZe

Thanks a lot @liZe 🙂 will have a look )

ildarworld avatar Jan 27 '24 18:01 ildarworld

The second problem is now fixed in main.

liZe avatar Jun 07 '24 07:06 liZe