Skip to main content
October 20, 2009
Answered

New Browser Window from Hyperlinks on PDF created in In Design

  • October 20, 2009
  • 6 replies
  • 179416 views

I am creating PDF documents using In Design CS3.  The PDFs have hyperlinks to other PDFs as well as hyperlinks to webpages. The finalized PDF is being accessed through our website as a link on the webpage. The PDF is opening in a new browser window/tab and the hyperlinks are working great.  My problem is this: How do I get it so that the hyperlinks on the PDF open to a new browser window as well.  Currently, when I click a link, it changes the current browser window that the PDF is in.  I want to set this so that anyone, from any computer will have it so that the link opens a new window/tab.

This topic has been closed for replies.
Correct answer

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);

9.     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.

10. Click OK to close the JavaScript Editor dialog box.

11. Click OK to close the Link Properties dialog box.

12. 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.

6 replies

nm61973955
New Participant
October 18, 2018

This is great to find a solution--this works for IE. However, it does not work for PDFs opened in Chrome. Anyone have another solution?

BobLevine
Community Expert
Community Expert
October 18, 2018

Ask Google. It's their browser.

divyangr17553871
New Participant
December 20, 2017

Doesnt work in Chrome

runninghead_design
Inspiring
June 20, 2017

Wow. This Adobe Acrobat thingy is such a breeze to work with

Please be aware folks that relying on JavaScript to get new browser window links working in your PDFs relies on... well ... JavaScript, so some devices and configurations may cause the technique to fail.

runninghead_design
Inspiring
June 20, 2017

Typically, Edit Post is failing too (in Chrome, on Mac El Capitan), so I'd just like to say that the technique also fails in Safari, which is pretty good at handling PDFs.

New Participant
May 19, 2011

Wow, I am so glad to see I am not the only one having this problem!  So frustrating!  Is there any feature that allows us to make the PDF links open in a new browser window that is built in to In Design CS5?  The work around suggested above to do in Acrobat is simply not feasable for the amount of updates we do to this large manual we have created.  The only other option we have considered is to change the settings on all 100+ department computers in Adobe Reader - Edit - Preferences - Internet - uncheck the "Open in Browser" box.  But this too is a very large task and only fixes the problem internally.  I was hoping InDesign would have a built in option to click this preference when exporting it to a PDF.

Please, any other ideas before I throw my work computer of the balcony!

Participating Frequently
May 19, 2011

Surfing Orangutan wrote:

Wow, I am so glad to see I am not the only one having this problem!  So frustrating!  Is there any feature that allows us to make the PDF links open in a new browser window that is built in to In Design CS5?  The work around suggested above to do in Acrobat is simply not feasable for the amount of updates we do to this large manual we have created.  The only other option we have considered is to change the settings on all 100+ department computers in Adobe Reader - Edit - Preferences - Internet - uncheck the "Open in Browser" box.  But this too is a very large task and only fixes the problem internally.  I was hoping InDesign would have a built in option to click this preference when exporting it to a PDF.

Please, any other ideas before I throw my work computer of the balcony!

I haven't read the thread too closely, so this may be redundant:

Search Google for terms like "Search Google for terms like "html command to open link in new window" without quotes.

HTH

Regards,

Peter

_______________________

Peter Gold

KnowHow ProServices

    
Correct answer
February 22, 2011

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);

9.     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.

10. Click OK to close the JavaScript Editor dialog box.

11. Click OK to close the Link Properties dialog box.

12. 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.

Participating Frequently
February 23, 2011

wow, thank you so much!

Participating Frequently
February 19, 2011

Senrab, did you ever get this solved off line? I'm trying to do the same thing. Using InDesign CS3 to create docs with hyperlinks to PDFs, which always open in the same window, forcing viewer to "page back" to original PDF where the link source is, or if they close the window with the link destination, they close the document. I have tried viewing the PDF with links in Reader X and Acrobat 8. Results the same.

If you figured it out or have a work around, would you share please?

Shelley