Re: Adjusting flowable position
Andy Robinson <[email protected]>
| Newsgroups | gmane.comp.python.reportlab.user |
|---|---|
| Message-ID | <CABjtApvC375XG+CfDT-E7W0swhUMkSt5Yu-rCfp8R1=TG-Q99Q@mail.gmail.com> |
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 <[email protected]> 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 > > [email protected] > +372 5661 6933 > skype: elver.loho > _______________________________________________ > reportlab-users mailing list > [email protected] > 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