Ensuring PDF hyperlinks open in a new tab or window in ALL browsers
发布时间:2026-09-16 | 浏览:2
App communities
Ensuring PDF hyperlinks open in a new tab or window in ALL browsers
Hello. I previously posted this in InDesign support but now it's for Acrobat. I followed the advice below (thanks senrab75 ) to 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.
Access the Link tool (Tools > Advanced Editing > Link Tool)
Right click on the hyperlinked text and select Properties
In the Link Properties dialog box click on the Actions tab
In the middle of the Actions panel in the Actions section click on the Open a web link action listed there to select it.
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.
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.
Click the Add… button.
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);
Change the hyperlink text between the quotation marks to your desired URL.
Ex: app.launchURL(" http://www.cnn.com ", true);
The code is case sensitive so make sure you typed app.launch URL NOT app.launch url or some other case combination.
Make sure that you have quotation marks around your hyperlink URL.
Make sure there is a semicolon at the end of the line of code you just typed.
Make sure that the quotation marks are straight up and down – not on an angle.
Click OK to close the JavaScript Editor dialog box.
Click OK to close the Link Properties dialog box.
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.
Edit and convert PDFs
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 link ' as shown below. Then, clicked on the 'Copy Link' button.
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.
Works from OneDrive too.
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.
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
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
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?
> 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.
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)
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.
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.
The link works but still opens in the same tab in Chrome, rather than a new window or tab.
Any Suggestions?
Report this issue to the developers of Chrome.
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
The makers of each browser constantly change the PDF viewers. They do not tell anyone or keep a compatibility chart. Expect constant random change.
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.
It does work in Firefox BTW
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.
Remix with Firefly Community Gallery
Thousands of free creations to fall in love with and remix in Firefly.
Already have an account? Login
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign in to Adobe Community
No account yet? Create an account
To post, reply, or follow discussions, please sign in with your Adobe ID.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.