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 (将#修改为@)