相关疑难解决方法(0)

在ReportLab中向canvas元素添加超链接的最简单方法是什么?

我正在使用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()
Run Code Online (Sandbox Code Playgroud)

python canvas reportlab hyperlink

5
推荐指数
1
解决办法
3640
查看次数

标签 统计

canvas ×1

hyperlink ×1

python ×1

reportlab ×1