[reportlab-users] Page Breaks with Paragraphs(tables?)
reportlab-users@reportlab.com
reportlab-users@reportlab.com
Thu, 28 Oct 2004 13:19:25 -0700
On Wednesday 27 October 2004 10:33 am, Tim Johnson wrote:
> * jpywtora@calpoly.edu <jpywtora@calpoly.edu> [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 ......
> thanks
> tim
Ok here is the allowSplitting example.
doc =3D SimpleDocTemplate(
filepath,
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 (
# R1
# (C1, C2)
(Paragraph(_escape(text), BLOCK_TITLE), ''),
# R2
#(Paragraph(_escape(text), BLOCK_TITLE), ''),
)
detail_table =3D Table(
detail_table_data,
DETAIL_TABLE_COLUMN_SIZES,
DETAIL_TABLE_ROW_SIZES,
DETAIL_TABLE_STYLE,
)
=46rom my usage of reportlab tables need at least two columns and n number =
rows.=20
So that is the purpose of the empty column above. Hope this helps.
Johnny P
=2D-=20
Windows
Start Here
=46rustrating Hanging Crashing
Blue Screen of Death
Reboot