[reportlab-users] Bug with keep with next and Indenter?

Robin Becker robin at reportlab.com
Wed Jul 12 03:48:45 EDT 2006


Ilpo Nyyssönen wrote:
> Should this work?
> 
> --8<---------------cut here---------------start------------->8---
>     normalStyle = styles.ParagraphStyle(name = 'normal')
>     keepStyle = styles.ParagraphStyle(name = 'keep', keepWithNext = True)
>     content = [
>         platypus.Paragraph("line 1", keepStyle),
>         platypus.Indenter(left = 1 * units.cm),
>         platypus.Paragraph("line 2", normalStyle),
>         ]
>     doc = platypus.SimpleDocTemplate('proof.pdf')
>     doc.build(content)
> --8<---------------cut here---------------end--------------->8---
> 
> I get this error with ReportLab 2.0:
> 
> Traceback (most recent call last):
>   File "./proof.py", line 26, in ?
.......
> AttributeError: Indenter instance has no attribute 'width'
> 
short answer no and I suspect it can be fixed by either returning 
width,height==0,0 or by removing the effect of the keepWithNext from the 
Indenter. I added a breaking test so it'll get fixed.

-- 
Robin Becker


More information about the reportlab-users mailing list