如何在ReportLab Python中创建内部链接?

问题描述 投票:1回答:1

我想在一个20页的PDF中创建一个按钮,这样,如果我单击第5页中的按钮,则PDF转到第8页。在ReportLab上找不到此参考或代码示例。文档。

python python-3.x reportlab
1个回答
0
投票

Reportlab支持内部段落标记,例如

<link destination="end" >Go to the end (go to document internal destination)</link>
<link destination="start" color="cyan">Go to the beginning</link>

<setLink destination="start" color="magenta">This is the document start
  (define document destination inside paragraph, color is optional)</setLink>

对于图形元素,您可能会发现此post有用,这是我能找到的最好的。支持具有canvas.acroform.checkbox的Form元素,您可以在其中找到字段标志标记和值为'pushButton'的值,但我找不到如何将其与内部目标链接的方法。看来您需要自己绘制按钮。

除了上述内容,您当然还有TOC功能,但这是将收集的内容链接在一起。

© www.soinside.com 2019 - 2024. All rights reserved.