• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
8

Ensuring PDF hyperlinks open in a new tab or window in ALL browsers

New Here ,
Feb 27, 2020 Feb 27, 2020

Copy link to clipboard

Copied

Hello. I previously posted this in InDesign support but now it's for Acrobat. I followed the advice below (thanks senrab75to ensure my PDF links – when open in a browser – open in a new tab/window. This worked beautifully in Firefox but not in Chrome or Safari – same for most. According to Windows users, it worked in IE. Any advice?

Also, it's ok to do the below in a small document but – as a lot of people noted in the previous chat – when it's a large document with multiple links, it is tedious. Would be great if Adobe developers could add this feature to all their design programmes when creating hyperlinks...

Thank you. 

 

From senrab75 :

In Adobe Acrobat (the application, not the .pdf reader) use the Link Tool to edit the hyperlinked text object. Remove the “Open a web link” action assigned by default to handle the hyperlinked text when clicked. Assign a new action to the linked text that will open the hyperlink in a new window.

Note: The links have to be established each time you create a PDF – they do not carry over from In Design or any other software.

  1.      Access the Link tool (Tools > Advanced Editing > Link Tool)
  2.      Right click on the hyperlinked text and select Properties
  3.      In the Link Properties dialog box click on the Actions tab
  4.      In the middle of the Actions panel in the Actions section click on the Open a web link action listed there to select it.
  5.      Click the Delete button located just below that section in the lower right corner. This removes the action from the list and the Actions section should now be empty.
  6.      In the Add an Action section right above the Actions section click on the Select Action drop down menu and select the Run a JavaScript action from the list.
  7.      Click the Add… button.
  8.      In the JavaScript Editor that opens up, click your cursor in the Create and Edit JavaScripts area, like you would in a word processor to begin typing, and type the following line:

app.launchURL("http://www.MySampleURL.com/someFolder/somePage.html", true);

  1.      Change the hyperlink text between the quotation marks to your desired URL.

Ex: app.launchURL("http://www.cnn.com", true);

Caution:

  1.      The code is case sensitive so make sure you typed app.launchURL NOT app.launchurl or some other case combination.
  2.      Make sure that you have quotation marks around your hyperlink URL.
  3.      Make sure there is a semicolon at the end of the line of code you just typed.
  4.      Make sure that the quotation marks are straight up and down – not on an angle.
  5. Click OK to close the JavaScript Editor dialog box.
  6. Click OK to close the Link Properties dialog box.
  7. Save the .pdf and test your .pdf hyperlink by opening the .pdf document in a browser, click the link and check to see that it opens in a new browser window.
TOPICS
Edit and convert PDFs , How to

Views

185.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2020 Feb 28, 2020

Copy link to clipboard

Copied

No, because you can't control which PDF plugin will be used to open the file and whether or not it will execute this code correctly (or at all). If you find a plugin that doesn't work correctly, complain to its developers.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 16, 2020 Aug 16, 2020

Copy link to clipboard

Copied

Not working for me in chrome not in edge.
When I add the JS the link works from Acrobat, but does not work at all in the browsers, unclickable.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 29, 2020 Oct 29, 2020

Copy link to clipboard

Copied

Same here

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 29, 2020 Oct 29, 2020

Copy link to clipboard

Copied

It does work in Firefox BTW

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 22, 2020 Sep 22, 2020

Copy link to clipboard

Copied

I tried this a few months back and it worked perfectly. But for some strange reasons when I do it again this time the links are not working when I view the PDF online. Any idea how to fix this?

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 22, 2020 Sep 22, 2020

Copy link to clipboard

Copied

The makers of each browser constantly change the PDF viewers. They do not tell anyone or keep a compatibility chart. Expect constant random change.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

This instruction didn't work for me at all, link is still opening up in the same web browser page, I'm on PC so I still have to do Ctrl + click to open the link to a separate web browser page. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 15, 2021 Jan 15, 2021

Copy link to clipboard

Copied

The link works but still opens in the same tab in Chrome, rather than a new window or tab.

 

Any Suggestions?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2021 Jan 15, 2021

Copy link to clipboard

Copied

Report this issue to the developers of Chrome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 01, 2021 Mar 01, 2021

Copy link to clipboard

Copied

It is imperative that the link is javaScripted as app.launchURL("http://www.MySampleURL.com/someFolder/somePage.html", true);

Note the true value. See: https://www.amyuni.com/WebHelp/JavaScript_SDK/app/Methods/app_launchURL.htm

 

If problem still occurs consider that the browser(s) may not be updated to the most current version.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 01, 2021 Mar 01, 2021

Copy link to clipboard

Copied

This will NOT work in all browsers, even if you use the latest versions.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2021 Jul 20, 2021

Copy link to clipboard

Copied

Ok, I don't understand what the solution is then. Can you help? Is there a javascript that will work to open a link in another tap or window in Chrome, Safari and Firefox?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2021 Jul 20, 2021

Copy link to clipboard

Copied

@try67 Q is for you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2021 Jul 20, 2021

Copy link to clipboard

Copied

See TSN's reply below. Basically, there is no global solution for this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 20, 2021 Jul 20, 2021

Copy link to clipboard

Copied

1. There is no solution.

2. Accept that interactive PDF is wildly random, and don't expect it to work unless you can control the systems and apps in use.

3. If you still want a solution, see step 1.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 28, 2022 Mar 28, 2022

Copy link to clipboard

Copied

Sigh.  I just tried the above technique on the links in a PDF, but it doesn't work in either Edge or Chrome.   😞

It was worth a try.  Thanks anyway.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 29, 2022 May 29, 2022

Copy link to clipboard

Copied

I, also, have been trying to have a number of online videos that are linked to a pdf e-book, to open in a new window, but no success, even with this Java Script attempt. What if the pdf were converted to an html5? Could the video links then be set to open in a new window?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 29, 2022 May 29, 2022

Copy link to clipboard

Copied

> What if the pdf were converted to an html5? Could the video links then be set to open in a new window?

 

Yes, when the browser support it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 30, 2022 May 30, 2022

Copy link to clipboard

Copied

So, are you saying that while with an online PDF with links to Vimeo or
Youtube videos are NOT able to be set up so that they open in a new window,
but by converting the entire pdf to html5 that those same links to videos
CAN be set up or programmed so that they DO open in a new window?

But, that the different way to "set up" the links in html versus setting up
the links in pdf, may or may not open the videos in a new window depending
on the browser (Chrome, Safari, Firefox, Edge, Internet Explorer, Bing,
etc) ??

--
Paul Gittelsohn
(personal info removed by mod)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 30, 2022 May 30, 2022

Copy link to clipboard

Copied

As I said before

1. There is no solution.

2. Accept that interactive PDF is wildly random, and don't expect it to work unless you can control the systems and apps in use.

3. If you still want a solution, see step 1.

This applies too to what browsers might do with HTML links. The concept of "open a new window" does not even exist in many browsers, for example Safari on iPhone, where there is only one "window".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 16, 2022 Jun 16, 2022

Copy link to clipboard

Copied

Thank you or this info.   Do you think it would be possible to make an Action to automatically convert all the links in a document from the standard link to the Javascript version?  I've made small actions before, but this one is over my head.

Savin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 16, 2022 Jun 16, 2022

Copy link to clipboard

Copied

This can't be done with an Action in Acrobat. It might be possible with plugin. It's certainly possible using a stand-alone tool, like this (paid-for) one I've developed that does just that: https://www.try67.com/tool/convert-all-links-in-a-pdf-to-open-in-new-window

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2022 Aug 09, 2022

Copy link to clipboard

Copied

hi Guys -

 

I have Index.pdf which has 10 hyperlinks to other pdf files ( A.pdf  B.pdf C.pdf etc) in the same folder..

when i click the link for A.pdf - both Adobe Reader and Adobe Pro close the index.pdf and open A.pdf in its place.

 

I do not want index.pdf to be closed, but instead want A.pdf , B.pdf , C.pdf to open in new tab or new window when links are clicked.

 

Is there a way to change behaviour of all hyperlinks in a PDF ?

 

I have used a create custom link from text java tool from try67

 

please help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 07, 2022 Aug 07, 2022

Copy link to clipboard

Copied

Today, I was trying to solve this issue coming from the same pain point stated in the original post -- as I went through a PDF file (open in Chrome) to test the embedded links, to click any of them resulted in the link opening within the same browser tab. To return to the file, I continued to use the Back button. By doing so, the file reloaded itself, forcing me to scroll to the location of the last link I had just tested. This process became cumbersome in a file with over 30 pages and  3X that many links.

The solution I found that works for me (tested in Chrome, Firefox, Edge) as of August 7, 2022 is as follows:


  • Create PDF file with links.
    In my case, I had generated a PDF from a PowerPoint slideshow presentation file. Later, I edited several links already embedded in that PDF file using Adobe Acrobat DC and resaved it there, but I doubt that step produced any significance -- now you can know, if yours differs.
  • Upload that PDF file to a FREE Google Drive service. 
  • Once file is uploaded, generate a Shareable Link from it:
    >>>>>>     RIGHT-CLICK ON FILE.       >>>>>    SELECT 'GET LINK' FROM MENU.
    Under General Access of window, I selected 'Anyone with the linkas shown below. Then, clicked on the 'Copy Link' button.
    saurabhb23733447_0-1659902715760.png
  • Launch a browser.
  • Paste copied link into url address field.
  • Pressing Return / Enter should open PDF file in that browser.
  • In open PDF file, click any link:
    IT OPENS IN A NEW TAB.  NOT IN THE SAME TAB.  BUT ALSO --  NOT IN A NEW WINDOW.   


Since this solution works for me, I decided to test it across some of the other cases I read users discussing here in this post. I tested this on my PC using Chrome, Firefox and Edge browsers with the same success in each of them.
I also opened the link in Chrome on my Android cell phone for identical results.

I did not test for cases on Macs, Safari or iPhones, but on an Android phone, this process flowed seamlessly. Yay!
Hoping this helps some of you as well.
   

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines