【发布时间】:2012-05-21 16:25:19
【问题描述】:
我正在使用 ReportLab 使用 Python 制作 pdf。我想在画布上添加一个形状,并让该形状充当超链接。将以下示例中的矩形链接到 google.com 的最简单方法是什么?
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch
c = canvas.Canvas("hello.pdf")
# move the origin up and to the left, draw square
c.translate(inch,9*inch)
# How do I make this rectangle link to google.com?
c.rect(inch,inch,1*inch,1*inch, fill=1)
c.showPage()
c.save()
【问题讨论】:
标签: python canvas hyperlink reportlab