[reportlab-users] Bug in RL 2.3: XPreformattedFit and keepwithnext add spurious page

Robin Becker robin at reportlab.com
Thu Oct 15 10:20:58 EDT 2009


Roberto Alsina wrote:

> Consider this script:

>

> --------------------------------------

>

> styles = getSampleStyleSheet()

> doc = SimpleDocTemplate("issue216.pdf")

>

> knstyle=copy(styles['Normal'])

> heading=Paragraph('A heading at the beginning of the document',knstyle)

> heading.keepWithNext=True

> content= XPreformatted('This is the content\n'*120,styles['Normal'])

>

> doc.build([heading,content])

>

> --------------------------------------

>

> If I don't set heading.keepWithNext to True, it produces a document that

> starts with 'A heading ....' followed by 'This is the content' repeated 120

> times.

>

> With keepWithNext set to True, there is a pagebreak at the beginning of the

> document (see attached PDF file).

>

> This is with reportlab 2.3

>

> Full test program here:

> http://code.google.com/p/rst2pdf/source/browse/trunk/rst2pdf/tests/input/test_issue_216.py

........

thanks for the bug report. I'll try and have a look at the weekend to see if I
can figure out what is going on.
--
Robin Becker


More information about the reportlab-users mailing list