I am making an interactive graph using reportlab. Each bar in the graph is a link to information related to the data represented by that bar, and this functionality works well.
When I hover over a bar, I see the url that the bar links to. I would like to add some text to this “tooltip”, such as the title of the webpage that I am linking to.
I have looked at a few mailing list threads, and searched the reportlab user’s guide, but I can’t find anything that gives a definitive answer. Is this possible?
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch
c = canvas.Canvas("hover.pdf")
# This square links to google.com.
# How do I make the message "Go to google" appear when the user
# hovers over this square?
c.rect(0*inch, 0*inch, 1*inch, 1*inch, fill=1)
c.linkURL('http://google.com', (0*inch, 0*inch, 1*inch, 1*inch), relative=1)
c.showPage()
c.save()
This is supported by the PDF itself, see http://indesignsecrets.com/showing-and-hiding-objects-in-interactive-pdf.php
But it is not supported by ReportLab. You can try bringing this feature up again on the ReportLab mailing list, someone asked for the same thing here a year ago http://permalink.gmane.org/gmane.comp.python.reportlab.user/10225