What is the simplest way to add a hyperlink to a canvas element in ReportLab?

眉间皱痕 提交于 2019-12-05 08:52:05

Call linkURL on the Canvas:

c.linkURL('http://google.com', (inch, inch, 2*inch, 2*inch), relative=1)

The rectangle is the clickable area, so you'd have to match that to the drawn rectangle. The arguments are two coordinates, twice x, y for the bottom-left and top-right corner.

See more examples in this blog post: http://www.hoboes.com/Mimsy/hacks/adding-links-to-pdf/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!