[reportlab-users] Newbie Page Breaks

reportlab-users@reportlab.com reportlab-users@reportlab.com
Thu, 23 Sep 2004 02:05:30 -0700


You are woirking with the 'canvas' layer which is just for drawing on
one page.  You need to work with the 'platypus' layer, which is 
fundamentally
about managing flow down the page.

If you are doing order forms or other things, you'll be creating a 
bunch of
mini-tables or perhaps one bigger table and adding them to the story,
rather than a sequence of paragraphs and headings.  The User Guide
chapters on Platypus explain this.

I suggest you also run the test suite (reportlab/test/runAll.py) then 
look
at the tests with 'test_platypus...' in the name.  Each one will have
a separate PDF output page.  (If on version 1.19 these will probably
be in the test directory; on the very latest code these will be in a 
separate
temp directory which it names as it creates them).

We've also just added a feature to make it easier to do 'continued on
next page', 'continued from', and table equivalents - this is likely to 
be
in a release next week.

Best Regards,

Andy Robinson
CEO/Chief Architect
RepoortLab Europe Ltd.
tel +44 20 8544 8049

-----Original Message-----
From: Graeme <graeme.matthew@contrado.com.au>
To: ReportLabUserList <reportlab-users@reportlab.com>
Sent: Thu, 23 Sep 2004 16:50:02 +1000
Subject: [reportlab-users] Newbie Page Breaks

G'day


I downloaded reportlab this morning as I need to generate order PDFs.

I have read the doco but am still a bit confused and I have searched 
the net looking for a complete example

There is a definite problem with my understanding. Obviously reportlab 
does not auto generate page breaks so I have to do it.
My content list has about 200 order items in it but it only writes to 
one page.

For example:

c = canvas.Canvas(filename)
c.setPageCompression(0)

textobject = c.beginText()
textobject.setTextOrigin(5, 800)
textobject.setFont("Courier", 8)
textobject.textLines("\r\n".join(content))
c.drawText(textobject)
doc.multiBuild(story)
c.save()

Can anyone help with some pointers on how one controls page break, I am 
also confused as to which base class
should be used to generate a simple PDF

many thanks, and lastly this is an awesome product !!!!!!