[reportlab-users] Flowable for duplex printing

Dinu Gherman gherman at darwin.in-berlin.de
Mon Sep 1 12:29:02 EDT 2008


Chad George:


> I'm working on a project where the document needs to be able to be

> duplex printed.

>

> The document being generated is actually a collection of a lot of

> smaller documents. I want to ensure that each sub-document starts on a

> "front/odd" page when the entire package is printed duplex.

>

> To this end I want to have a Flowable that will do either one-or-two

> pagebreaks to ensure the next page written on is "odd".

>

> I looked at the Flowable interface but couldn't see how to access the

> current document object to determine which page it is currently

> "drawing" on (odd or even).


I haven't tried this yet, but a flowable usually makes use of its
"canv" instance variable (see e.g. XBox.draw). And the Canvas class
keeps a "_pageNumber" instance variable. So, normally I'd expect you
to get something like a DoublePageBreak class by subclassing the
PageBreak one. Hmmm, looking at the code... or by making a variant
of its UseUpSpace base class...

Regards,

Dinu



More information about the reportlab-users mailing list