[reportlab-users] FW: linkAnnotate and linkRect, relative to transforms : Bug Report for trunk?
Ian.Sparks at etrials.com
Thu Apr 12 09:28:05 EDT 2007
This one didn't get through last time I sent it... So here goes again.
I use linkRect() a lot and I also do a lot of scaling and translating.
When I updated to trunk all my linkRects were off by a considerable
margin from where I expected them to be. Today I finally tracked down
the issue. It's the parameter "relative" that linkRect now takes. Here's
an example program that shows the problem. I think the fix is to make
the default relative value for a linkRect be = 1/True.
Basically, a linkRect() with relative = True will obey the
scaling/translations (which is what I want!) but linkAbsolute I think is
meant to be a link related to the default page and so passes relative=0
Can we have :
def linkRect(self, contents, destinationname, Rect=None,
addtopage=1, name=None, relative=1,
thickness=0, color=None, dashArray=None, **kw):
In canvas.py please? Alternatively I'll have to change all my calls to
Finally. I thought scaling and transforms were supposed to be additive?
My last example I scale by 50% then move 5 inches up. Doesn't look like
anything is scaled anymore?
Test prog :
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch, cm
from reportlab.lib import colors
canv.linkAbsolute("test1", "t1",(inch, inch, 6*inch,
2*inch),Border='[1 1 1]')
if __name__ == '__main__':
canv = canvas.Canvas('test.pdf')
#Make 50% smaller
#Move origin up 5 inches
makePage(canv,'Scaled and moved 5 inches up')
This e-mail communication and any attachments may contain
confidential and privileged information and is for use by the
designated addressee(s) named above only. If you are not the
intended addressee, you are hereby notified that you have received
this communication in error and that any use or reproduction of
this email or its contents is strictly prohibited and may be
unlawful. If you have received this communication in error, please
notify us immediately by replying to this message and deleting it
from your computer.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the reportlab-users