如何使用JsPDF添加HyperLink?

时间:2016-06-20 09:34:50

标签: jspdf

是否可以在HyperLink中添加jsPDF

这是我正在使用的代码。

    var doc = new jsPDF('p', 'pt'); 
    doc.fromHTML(
     '<a href="http://www.google.com">Click Here</a>',
     35,
     25,
     {
         'width': 180, 'elementHandlers': elementHandler
     });
     doc.save("info.pdf");

1 个答案:

答案 0 :(得分:11)

在过去两个小时后我得到了解决方案。 在jsPDF中还有一种不太流行的方法,即

doc.textWithLink('Click here', x, y, { url: 'http://www.google.com' });

希望它会帮助某人:)