[reportlab-users] Miscalculation when using keepWithNext

Pierre Ossman ossman at cendio.se
Thu Dec 23 08:07:20 EST 2021

On 14/12/2021 11:17, Robin Becker wrote:
> I will take a look at the 'bug' as exposed in your example.
> I assume this is the line you want to change flowables.py:643
>  > if w<=_FUZZ or h<=_FUZZ: continue

Right. Or the corresponding behaviour in Frame. Either behaviour is fine 
with me, it's the discrepancy between the two that is the problem.

> to see what happens if the spacer is not invisible. Is there an issue 
> that requires zero width for the spacer?

Not to my knowledge, no. But this spacer comes from rst2pdf and it's not 
something I'm that familiar with. We saw the issue as users of rst2pdf, 
not developers of it.

> If the spacer is controlled by some other software then presumably a 
> simple fix is just to change its class or to define an attribute which 
> controls the w<=FUZZ issue.
> I ran a render test (401 pdfs) with this line
> if (w<=_FUZZ and False) or h<=_FUZZ: continue
> and saw no changes. It does not mean that others will have the same 
> result though.

Our workaround for the moment is to override the spacer in rst2pdf and 
makes sure it has minimum dimensions of 1x1, which seems to work fine.

But it would be nice to remove that workaround eventually, and hopefully 
let others avoid this issue. :)

Pierre Ossman           Software Development
Cendio AB               https://cendio.com
Teknikringen 8          https://twitter.com/ThinLinc
583 30 Linköping        https://facebook.com/ThinLinc
Phone: +46-13-214600

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

More information about the reportlab-users mailing list