微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

linktoDestination 不适用于 pdfmake

如何解决linktoDestination 不适用于 pdfmake

目前我正在使用 pdfmake 将 html 转换为 pdf,这是我第一次使用它。

我正在尝试将 Ashish、twitter、aaa 链接到他们的特定部分。 我尝试在 playground 上运行以下代码,但仅用于导航到该部分。

// playground requires you to assign document deFinition to a variable called dd

var dd = {
    content: [
    {
        "columns": [
            {
                "text": "","priority": 0
            },{
                "stack": [
                    "2/17/2021,2:41:01 PM",{
                        "text": "AshishTemplate v4"
                    }
                ],"style": {
                    "alignment": "right"
                },"priority": 1
            }
        ]
    },{
        "text": "\n Table of Contents \n\n","style": "header"
    },{
        "columns": [
            {
                "text": "Ashish","width": "auto","style": "tableOfContents","linkToDestination": "Ashish1"
            },{
                "text": "Twitter","linkToDestination": "Twitter1"
            },{
                "text": "aaa","linkToDestination": "aaa"
            }
        ],"columnGap": 10
    },{
        "text": "Ashish","style": "sectionHeader","id": "Ashish1"
    },"",{
        "columns": [
            {
                "width": "100%","text": ""
            }
        ]
    },{
        "text": "Twitter","id": "Twitter1"
    },"AShish",{
        "columns": [
            {
                "style": "listViewTable","table": {
                    "widths": [
                        "50%","50%"
                    ],"body": [
                        [
                            "Address","-"
                        ],]
                },"layout": {
                    "defaultBorder": false
                }
            }
        ]
    },{
        "text": "aaa","id": "aaa"
    },"aa","stack": []
            }
        ]
    }
]
}

我错过了什么? Ashish 和 Twitter 不应该有指向他们特定部分的链接吗? 我想要的目录输出如下:

Ashish Twitter aaa

每当用户将鼠标悬停在文本上时,用户应该能够点击它并导航到该部分。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。