[reportlab-users] Page Breaks with Paragraphs(tables?)
Thu, 28 Oct 2004 13:19:25 -0700
On Wednesday 27 October 2004 10:33 am, Tim Johnson wrote:
> * email@example.com <firstname.lastname@example.org> [041027 09:01]:
> > On Tuesday 26 October 2004 06:11 pm, Tim Johnson wrote:
> > > ## builds a pdf file properly, but I would like to find a strategy to
> > > ## introduce "page breaks" so that paragraphs do not span pages.
> > > ## I would welcome examples, instructions or pointers to such..
> hello Johnny:
> > How about putting the paragraph in a table? It is also possible to turn
> > off allowsplitting (allowSplitting =3D 0) in the constructor of
> > SimpleDocTemplate which may, or may not work. Just some quick thoughts.
> That sounds like a good idea, I had thought about it myself after
> looking at the docs (userguide.pdf) Unfortunately, I can't find any
> code examples, so I don't really know how to start ......
Ok here is the allowSplitting example.
doc =3D SimpleDocTemplate(
allowSplitting =3D False,
pagesize =3D LETTER,
topMargin =3D 0.5 * inch,
leftMargin =3D 0.75 * inch,
rightMargin =3D 0.75 * inch,
bottomMargin =3D 0.5 * inch,
Now for the table example.
detail_table_data =3D (
# (C1, C2)
(Paragraph(_escape(text), BLOCK_TITLE), ''),
#(Paragraph(_escape(text), BLOCK_TITLE), ''),
detail_table =3D Table(
=46rom my usage of reportlab tables need at least two columns and n number =
So that is the purpose of the empty column above. Hope this helps.
=46rustrating Hanging Crashing
Blue Screen of Death