[reportlab-users] Page Break Question

Robin Becker robin at reportlab.com
Tue Apr 12 10:04:31 EDT 2011

On 12/04/2011 13:51, Elan Noy wrote:

> Is there any way to insert a page break that starts further output on an odd

> numbered page? In other words, if I am on an even numbered page, this would

> insert a single page break. If we are already on an odd numbered page, it would

> insert two page breaks.


> Thanks


yes you can use the DocIf flowable to issue page breaks until a particular
condition is met.

That would look something like
DocIf("doc.page%2 == 1",[PageBreak(),PageBreak()],[PageBreak()])

of course that assumes you have only one frame on the relevant pages. If that's
not true you should probably use a PageBegin action flowable.

Robin Becker

More information about the reportlab-users mailing list