[reportlab-users] Line numbers in Platypus

Robin Becker robin at reportlab.com
Wed Mar 19 12:08:41 EDT 2008


Jonathan Claggett wrote:

> Hello,

>

> I've just recently become aware of the RL toolkit (thus my first post to the

> list :-) and I'm evaluating it for use in generating legal bills* for a

> model UN youth organization.

>

> One of the requirements of these bills is that the body has line numbers and

> I'm not sure how or even if line numbering can occur with variable height

> objects like the Paragraph. My initial reaction after reading the user

> manual is 'probably'.

>

> At a hand waving level, I think I can subclass the BaseDocTemplate to create

> an afterFlowable method which determines how many lines a Paragraph or other

> flowable has used (using the wrap method?) which I then use to draw a

> sequence (maintained by the sequencer module) of line numbers in a separate

> frame down the left hand margin.

>

are you talking physical lines or total lines since the start etc etc. Certainly
it should be possible to figure out at wrap time how many lines a paragraph has
(or even at draw time) and use that to do something elsewhere on the same canvas.



> Does this above approach sound reasonable? Maybe Platypus has a line

> numbering feature already and I missed it? Perhaps someone has already

> created a line numbering document template that I could use?

>

> Thanks for any help you can provide.

>

> Regards,

> Jonathan

>

> * e.g., http://jonathan.claggett.googlepages.com/sample-bill.pdf

--
Robin Becker


More information about the reportlab-users mailing list