Will PDFmake support hyperlinks in PDFs
Possible format?
link: {url: 'http://www.bing.com, text: 'What is bing?'}
link: {url: 'http://www.bing.com, text: 'restyle part of it and make it bigger ', fontSize: 15 }
Yes, example:
{text:"Google", link:"http://www.google.com", decoration:"underline", fontSize:15}
But it only works on master branch (it contains this fix https://github.com/bpampuch/pdfmake/pull/487).
It works great, thanks @liborm85 ! But, is it possible to set _target=blank for link somehow?
@pemaxim Could you please help me out how to use this feature when using it as a hyperlink.?
@uanthwal Sorry, but I did not understand your question. Which feature are you asking about? If you're asking how to open links in new window, - there is no solution. Also, here is what I found:
PDFs are not marked up with HTML. How a link click is handled in a PDF depends on the PDF viewer you are using. Modern browsers with built-in PDF viewers may navigate to the page within the same frame as the PDF view and that is not something that can be controlled with an HTML element attribute. What happens if your link is clicked when the PDF is being viewed in Adobe Acrobat or Mac Preview? You're at the whim of the software and operating system. Sorry to bear the bad news but this is the reality of the PDF format.
Related topic: http://stackoverflow.com/questions/36637266/can-not-generate-blank-links-on-pdf-via-pdfkit-on-rails-app
@liborm85 is it possible to add a link to an image?
Maybe something like this...
{
image: 'data:image/jpeg;base64,...encodedContent...',
width: 150,
link: "http://www.google.com"
}
It works great, thanks @liborm85 ! But, is it possible to set
_target=blankforlinksomehow?
Did you find any solution for target blank
Most helpful comment
Yes, example:
But it only works on master branch (it contains this fix https://github.com/bpampuch/pdfmake/pull/487).