[reportlab-users] Experimenting with new paragraphs, splitting issue

Dinu Gherman gherman at darwin.in-berlin.de
Tue Dec 4 12:45:26 EST 2007


Robin Becker:


> We try to wrap a height 40 paragraph in available height 30. That

> fails, but the split cannot reduce the height. We flip to the next

> frame (also with available height 30) and try again; that fails so

> we give up. You probably wonder why we won't split into two lines.

> That is a hack in Paragraph.py where we always fail to split if

> trying to return a first split with only one line in. The intention

> is to avoid an orphan. If you intend to split lines into frames with

> only one line in them we need a different concept of layout.


I've modified my sample code to produce two lines per frame.
The traceback I get i the same with the same wrap height value
of 4.00, which I cannot make any sense of:

*** parse on_line_1 on_line_1 on_line_2 on_line_2 on_line_3
*** wrap (240.000000, 50.000000)
*** wrap (240.000000, 60.000000) needed
*** parse on_line_1 on_line_1 on_line_2 on_line_2 on_line_3
*** split (240.000000, 50.000000)
p1 on_line_1 on_line_1 on_line_2 on_line_2
p2 on_line_3
*** parse on_line_1 on_line_1 on_line_2 on_line_2
*** wrap (240.000000, 50.000000)
*** wrap (240.000000, 40.000000) needed
*** parse on_line_3
*** wrap (240.000000, 4.000000)
*** wrap (240.000000, 20.000000) needed
*** parse on_line_3
*** split (240.000000, 4.000000)
p1
p2 on_line_3
*** parse
*** wrap (240.000000, 4.000000)
*** wrap (240.000000, 20.000000) needed
Traceback (most recent call last):
File "test_twoframes.py", line 49, in <module>
main()
File "test_twoframes.py", line 45, in main
doc.build(story)
File "/usr/local/lib/python2.5/site-packages/reportlab/platypus/
doctemplate.py", line 740, in build
self.handle_flowable(flowables)
File "/usr/local/lib/python2.5/site-packages/reportlab/platypus/
doctemplate.py", line 663, in handle_flowable
raise LayoutError(ident)
reportlab.platypus.doctemplate.LayoutError: Splitting error(n==2) on
page 1 in
<Paragraph at 0x10f5da0 frame=F1>on_line_3

I've attached my new code...

Dinu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mini3.tgz
Type: application/octet-stream
Size: 3472 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20071204/35bc334e/attachment.obj>
-------------- next part --------------



More information about the reportlab-users mailing list