mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.77k stars 10.03k forks source link

Enable automatic URL hyperlinking #3172

Open amanjeet opened 11 years ago

amanjeet commented 11 years ago

In Adobe Reader by default anything with a www is being recognized as a URL and becomes linkable. It does not seem like the same thing works in pdf.js

gigaherz commented 11 years ago

Any recent version of Firefox lets you right-click on anything that looks enough like an URL and then do "Open Link".

melanieguymon commented 11 years ago

We have experienced this issue as well, especially in IE. We love the viewer so far, and that is the only issue we have come across. Do you think there will be a solution soon?

timvandermeij commented 11 years ago

@curliesue64 #3744 will probably address this.

Snuffleupagus commented 11 years ago

@timvandermeij Unfortunately this issue will not be fixed by that PR, since they are not the same. This issue is about automatically creating hyperlinks from any piece of text, which looks like a link. To implement this, you would have to check the content of every <div> in the textLayer. I'm not sure if we would want to do this, and if it was implemented it should certainly not be on by default.

websirnik commented 9 years ago

One solution would be to use something like this: https://github.com/gregjacobs/Autolinker.js

ubaidmohammed commented 9 years ago

@timvandermeij the pdf attached #6686 does have a hyperlink which is on the bottom left of the page. which takes me to http://www.cameronmoll.com/

can you please please re-check

thanks in advance

yurydelendik commented 9 years ago

It will be easier to implement it after #6689 (Also #6590 shall help with this a lot).

ghost commented 8 years ago

Hi guys, any updates on this? Will it be implemented?

tomyitav commented 4 years ago

Hi, any updates? Will it be implemented soon?

timvandermeij commented 4 years ago

This is not something I think anyone is working on. Moreover, it's far from trivial to implement since you'd have to detect URLs in text fragments that may be split up at any point in the document due to the way the PDF format handles text.

tomyitav commented 4 years ago

My solution was accessing the annotation layer, and putting links on a separate layer from the PDF canvas. Here is a nice jsfiddle solution I found.

CryptorClub commented 1 year ago

My solution was accessing the annotation layer, and putting links on a separate layer from the PDF canvas. Here is a nice jsfiddle solution I found.

Hello, thanks for link. jsfiddle example not working now (10 years ago solution). Console returns error: Uncaught ReferenceError: PDFJS is not defined

Any proposals how to upgrade it?

marco-c commented 3 weeks ago

@ryzokuken will work on this.