【问题标题】:How to create an internal link in ReportLab Python?如何在 ReportLab Python 中创建内部链接?
【发布时间】:2020-05-15 10:30:50
【问题描述】:

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

【问题讨论】:

    标签: python python-3.x reportlab


    【解决方案1】:

    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 的表单元素,您可以在其中找到字段标志标记和值为“pushButton”的值,但我找不到如何将其与内部目标链接。看来需要自己画按钮了。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-03
      • 1970-01-01
      • 2018-09-06
      • 1970-01-01
      • 2011-05-22
      • 2020-12-24
      相关资源
      最近更新 更多