[reportlab-users] Adjusting flowable position

Andy Robinson andy at reportlab.com
Mon Nov 11 02:23:03 EST 2013

The easiest way to do this will be by writing your own Flowable class.
It needs a wrap() method to return the desired size in the story, and
a draw() method to draw the bitmap and the line (and, possible, any
other key strings like 'Signed: ___' ) wherever you want.

Look in reportlab/platypus/flowables.py at the class XBox, a
super-simple custom flowable which draws a box with two big diagonals
(we had the name before MIcrosoft did!). This should be an easy one
to copy and adapt.

Hope this helps...

On 7 November 2013 17:25, Elver Loho <elver.loho at gmail.com> wrote:

> Hi all,


> I'm trying to solve a quite specific problem. I'm generating various

> reports, which all need a signature. In the interest of expediency,

> the client wants to have his signature affixed automatically and for

> that purpose I have been provided a transparent PNG of his signature.

> The problem is, however, that for a signature to look "natural", it

> should slightly overlap the line below it.


> While ReportLab provides magnificent functionality for putting an

> image, such as a signature, in a table and underlining the specific

> cell, I am unable to find any sort of functionality, which would

> accomplish what I wish to do.


> The normal approaches to solving this issue have been unfruitful. I am

> unable to find any functionality to tweak a flowable's z-order and

> position following its placement, nor any support for getting a

> flowable's position post-placement, so as to draw the signature on top

> of a placeholder, with slightly tweaked coordinates. However, my

> experience with ReportLab has been brief and it is likely I've missed

> some obvious functionality.


> Has anyone faced a similar problem? How did you go about solving it?


> Best,

> Elver


> elver.loho at gmail.com

> +372 5661 6933

> skype: elver.loho

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at lists2.reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users

Andy Robinson
Managing Director
ReportLab Europe Ltd.
Thornton House, Thornton Road, Wimbledon, London SW19 4NG, UK
Tel +44-20-8405-6420

More information about the reportlab-users mailing list