Open ghost opened 7 years ago
Hi @mkoske. I have to say I haven't tried that before myself, but I just tried it now and links don't work for me either.
Not really sure why that's so, to be honest. I won't have time to investigate this anytime soon, so if you or anyone else wants to see what might be the problem and open a PR to fix this -- I'd be happy to review such a PR.
Hello, at least with my Firefox (version 48.0.2) I was able to click links. I mean, isn't this package built on the same PDF.js project?
Now I found out, that the PDF-version in my Firefox is 1.4.258.
Edit: It seems that the version you're using is 1.3.146. I'll see if that's the problem.
It seems that if you wish to have such functionality, you should code it by yourself.
See here, files like annotation_layer_builder.js and pdf_link_service.js.
I am not familiar with this PDF.js project, but this is what it looks like to me. I have no time to look at this further, but hope this helps someone who has.
Thanks!
Just a comment: clicking on a link would be very useful and I would like to see that feature implemented as well, but for LaTeX documents, the user should be able to decide what happens when a link is clicked: follow the link, or sync with the LaTeX source file.
Note: reposting with my intended github user.
I also would like to have this feature. I might have some time to work on this (i.e. to procrastinate while writing my dissertation).
I have a question for @izuzak: Is it possible to reuse part the PDF.js web viewer (specifically the page viewer component)? It seems that it already implements everything needed to support any kind of links and annotations.
Currently, pdf-viewer has a PdfEditorView extending a basic ScrollView. It could extend PDFjs's PdfPageView... Of course, the pdf-viewer functionality already implemented would possibly need to be adapted... What do you think? Am I missing anything?
Hey @sherwoodinc 👋
Is it possible to reuse part the PDF.js web viewer (specifically the page viewer component)?
I don't know -- I haven't looked into how PDF.js works more than what I needed to build the package as it is.
What do you think? Am I missing anything?
I wish I could give you a 👍 or 👎 on the idea, but I can't -- I just don't know because I haven't dug that deep into PDF.js. I think it should be possible, but I'm not sure. I guess the best way to get an answer would be to try and build it. Unfortunately, I just don't have the time to work on that right now, but would be neat if someone using the package would want to give it a shot. 🌟
I'd love to get this working, but it seems that PDF.js is so poorly documented and has such incomprehensible code that I don't even understand where to start.
@mkoske What are your references to annotation_layer_builder.js and pdf_link_service.js supposed to show? It's not clear to me that the annotation layer has anything to do with links, and I'm not sure that PDFLinkService is useful for anything but links in the same document.
It's really frustrating. Both here and in the PDF.js repository, there appears to be interest in links in a PDF file, but every time someone gets close to posting useful information on how such a thing might be implemented, the discussion ends.
The atom-latex package has a built-in PDF viewer with clickable links. I'm not sure how they did it but if you speak JavaScript (unlike me), you might be able to understand.
@dpo Thanks, that’s worth a look. I worry that they might have done something TeX-specific, but we’ll see.
@dpo Are you sure that atom-latex opens PDF files within Atom at all? I haven’t tried that package, but from issues such as https://github.com/thomasjo/atom-latex/issues/453, I gather that it uses an external PDF viewer. Am I wrong?
@marnen Yes, it opens in Atom. It's not an external PDF viewer.
I mean this one: https://atom.io/packages/atom-latex
@dpo Huh, OK. I'll take another look (I have no use for LaTeX and so have been reluctant to install a package for it). I certainly don't see where in the code it brings in a PDF viewer, so this should be interesting. :)
@dpo Wait, I see, different package: you meant https://github.com/James-Yu/Atom-LaTeX. OK, looking there.
Doubly interesting: that package also uses PDF.js, so perhaps we can ~steal~adapt a thing or two from it.
Looks like https://github.com/James-Yu/Atom-LaTeX/pull/94 will be a good starting point. I wonder if it's really that simple...
I can't get the PDF viewer in that package to work at all (and no errors are shown...). I'll keep looking at the implementation, but it looks like this package may do things very differently. Maybe it shouldn't; I'm not sure.
@sherwoodinc:
I have a question for @izuzak: Is it possible to reuse part the PDF.js web viewer (specifically the page viewer component)? It seems that it already implements everything needed to support any kind of links and annotations.
Sure looks like it should be. Maybe that's worth a try.
Bump! Need to have this working for the package to be really useful!
Hello, seems I cannot click links on PDF. Is it possible at all? If not, is it problem with this package or PDF.js?