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

Roberto Alsina ralsina at netmanagers.com.ar
Wed Oct 14 23:48:56 EDT 2009

Consider this script:


styles = getSampleStyleSheet()
doc = SimpleDocTemplate("issue216.pdf")

heading=Paragraph('A heading at the beginning of the document',knstyle)
content= XPreformatted('This is the content\n'*120,styles['Normal'])



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

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:

("\''/").__..-''"`-. . Roberto Alsina
`9_ 9 ) `-. ( ).`-._.`) KDE Developer (MFCH)
(_Y_.)' ._ ) `._`. " -.-' http://lateral.netmanagers.com.ar
_..`-'_..-_/ /-'_.' The 6,855th most popular site of Slovenia
(l)-'' ((i).' ((!.' according to alexa.com (27/5/2007)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: issue216.pdf
Type: application/pdf
Size: 3818 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20091015/e7f68278/attachment.pdf>

More information about the reportlab-users mailing list