Skip to main content
Participant
July 26, 2018
Answered

open hyperlinks inside embedded pdf in a new window

  • July 26, 2018
  • 3 replies
  • 19498 views

Hello,

I created pdf documents with links opening in a new tab,with the app.launchURL method provided by the answers of the adobe community :

How do I open hyperlinks inside embedded pdf in a new window? (JavaScript)

But today, this is not working anymore in MS Edge and Chrome browsers...

When i ask Chrome to fix this bug, the answer is :

Looking through the PDFium code, we do have an implementation of app.launchURL in our code base. It is no-op though, with an explicit comment that this operation is considered unsafe and thus not supported. This appears to be a case where we have actively chosen to be non-compliant with the Adobe implementation.

And the bug is closed with the status : Won't fix...

865483 -  Javascript action to open hyperlinks inside embedded pdf in a new window not working -  chromium -  Monorail

So my question is : How do I open hyperlinks inside embedded pdf in a new window today in Chrome and MS Edge ???

The example in the following link is working as wanted in Firefox (ugly frames and links in new tab) but not in Chrome nore Edge.

https://dev.gaelgerard.com/testpdf.pdf

Is there another solution ?

Thank you

This topic has been closed for replies.
Correct answer try67

PS. The problem is not that the files are not compliant with the browsers, but the other way around. The browser (plugins) do not support the full Acrobat JavaScript protocol, although strictly speaking I don't think it's a part of the ISO specifications.

3 replies

Participant
January 9, 2019

All modern browsers these days have their own PDF reader built in. I've tried app.launchURL(url, true).

- Chrome can decode the URL, but it ignores the bNewFrame = true parameter.

- Edge cannot even decode the JavaScript, the hyperlink is dead.

- Firefox is the best, it can decode the URL from the JavaScript, and it opens the page in a new tab.

- IE doesn't have its PDF reader, it uses Acrobat, which means a new browser window pops up when you click.

If you want a standardized behavior across all browsers, try pdf.js. It's an open-source JavaScript PDF reader. It may or may not be able to handle the app.launchURL script, but it's open-source, so you could implement, or change the existing implementation to your needs. That's your best bet. PDFTron also has a JavaScript PDF reader, if I'm not mistaken, and they must have paid support in case you cannot deal with pdf.js on your own.

Participant
August 2, 2018

Thank you for your answer.

But will there be a solution one day to make pdf files compliant to major web browsers ??? Are there discussions with them ?

A lot of companies here in France still use PDF files and share them on their websites. Will there be an update of the file format in the future or are those files condamned to slow death like SWF ???

Best regards,

try67
Community Expert
Community Expert
August 2, 2018

I don't work for Adobe and can't speak for them, so I can't answer these questions. And the PDF format is out of the hands of Adobe, anyway. It's an ISO Standard now.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 2, 2018

PS. The problem is not that the files are not compliant with the browsers, but the other way around. The browser (plugins) do not support the full Acrobat JavaScript protocol, although strictly speaking I don't think it's a part of the ISO specifications.

try67
Community Expert
Community Expert
July 26, 2018

No, there's no other solution.