How to add HyperLink with JsPDF?

Is it possible to add HyperLink in jsPDF?

Here is my code which I am using for the same.

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

1 Answer

I got the solution after sicking from last two hours. there is also a method in jsPDF which is not so popular i.e.

doc.textWithLink('Click here', x, y, { url: ' });

Hope it will help someone :)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like