[reportlab-users] FW: Problem with linkAbsolute in trunk.

Ian Sparks Ian.Sparks at etrials.com
Thu Apr 12 09:28:56 EDT 2007



>>Ian Sparks wrote...


The following code should create a visible link-rectangle on the page.
When run against trunk and with Acrobat reader 7 the rectangle is
invisible although it does show the pointer-hand when you mouse over it.

<<



I tracked this down to the _annFormat() function of cavas.py :



Line 72 :



border = [0,0,0]



followed by line 77 :



D["Border"] = PDFArray(border)



Combine to spell doom to whatever Border you already passed in.



Here's my fix :



def borderArrayToPython(arr):

"""Turn '[X X X]' into [X,X,X]"""

return [int(item) for item in arr[1:-1].split(' ')]





Then at line 72 :



border = borderArrayToPython(D.get("Border","[0 0 0]"))



Borders are back in my test program below. Can someone at RL Europe
please validate this and then fix the svn trunk with something similar
(I don't know if you want the cryptic list comprehension)?



_____

From: reportlab-users-bounces at reportlab.com
[mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Ian Sparks
Sent: Wednesday, April 04, 2007 4:53 PM
To: Support list for users of Reportlab software
Subject: [reportlab-users] Problem with linkAbsolute in trunk.



The following code should create a visible link-rectangle on the page.
When run against trunk and with Acrobat reader 7 the rectangle is
invisible although it does show the pointer-hand when you mouse over it.



I don't think this is the only problem with links in trunk, but it's the
simplest test case I could get it down to.



from reportlab.pdfgen import canvas

from reportlab.lib.units import inch



canv = canvas.Canvas('test.pdf')

canv.bookmarkPage('t1')

canv.linkAbsolute("Find the Meaning of Life", "t1",(inch, inch, 6*inch,
2*inch),Border='[1 1 1]')

canv.showPage()

canv.save()



Anyone got the same problem?

_____






Disclaimer: 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.

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20070412/93d8d5d0/attachment.html>


More information about the reportlab-users mailing list