Closed DanielRuf closed 8 years ago
I have noticed this too (that links do not open in a new window) in another PDF, however I'm not sure if that worked before or if we just don't handle this correctly...
Based on this comment: https://github.com/mozilla/pdf.js/blob/master/src/shared/annotation.js#L636, I would say that it has never worked.
Is it better to have every link(URL's) to be opened in new tab ? Will that default behavior be better than opening it in the same tab and thereby disrupting reading/viewing the document
This is exactly what I meant (target=_blank not used in the PDF). I have the same opinion, it would be much better to open (external) links in new tabs.
@yurydelendik @brendandahl : your opinion on this issue ? can opening links in new tab be made the default behavior ?
I also think that opening links in a new tab (target="_blank") is better.
Yes, I've seen this. http://irclog.gr/#show/irc.mozilla.org/pdfjs/73494 But I have set the target as _blank in LibreOffice
It seems weird, that also the PDF file in Chrome does not open links in new tab but in the same tab if opened directly in the browser.
You can use this nice tool to browse the structure of a PDF file: http://brendandahl.github.io/pdf.js.utils/browser/.
Using that to open the file, I cannot find any references to target='_blank'
or anything else that would case that behaviour. Just because it works in LibreOffice, that doesn't mean that the generated PDF file behaves the same way.
Again, please note that there is no mentioning of this in the actual PDF file.
As far as I'm reading the PDF specification1, there is no support for opening in a new window with URI
actions (section 12.6.4.7).
There is however an optional newWindow
parameter for GoToR
actions (section 12.6.4.3), but PDF.js doesn't implement this.
@DanielRuf Your files all have links of the URI
kind, so based on the specification I don't believe that this will ever work like you seem to want. Even if we implement GoToR
action properly, this will unfortunately not help with your files!
[1] http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf
So, all this is just handled by the application where the PDF file is displayed so this will never change and is not a bug but feature?
Good to know that they did not add this to the specification =(
Reopened because opening external links in a new tab seems really useful to me. If this is not wanted as default behaviour, I think we should really at least add a preference to do so.
Reopened because opening external links in a new tab seems really useful to me.
Or you could just either middle-click or use the context menu for this functionality, just as you would on any website.
Sure, but I think it's quite tedious to constantly use the context menu to open links in a new tab. I don't think adding a simple preference for this would hurt UX. Note that I'm not saying it should be default behaviour, but just adding a preference to do it would help a lot. :-)
This can of course be done at a later time when preferences are implemented.
Any Updates on this issue? External links not working.
Not really. This will probably have to wait until #3850 lands.
Similar discussion at https://groups.google.com/forum/#!topic/mozilla.dev.pdf-js/miBFrMR1DIE
Can somebody submit the link to a test PDF document with action that has NewWindow
attribute? OpenOffice exports PDFs without such information.
The target attribute is missing in the latest version but in LibreOffice and the generated PDF the links have the target attribute.
Was this removed? Or is this a Google Chrome bug?