PDF Editing Issues

How to Make PDF Hyperlinks Open in a New Window

Muhammad TalhaMuhammad Talha Nov 24, 2026 869 views

Question details

The user needs to create a hyperlink in a PDF document that forces a webpage to open in a new browser tab or window rather than replacing the current document view.

How to Make PDF Hyperlinks Open in a New Window
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Adding an external web link to a PDF document without causing the reader to lose their place when the link is clicked.
Observed behavior
Standard PDF web links often open in the same tab, navigating the user away from the PDF file.
Before you start

Ensure you are using an advanced PDF editing application like Adobe Acrobat that supports custom JavaScript actions, as basic PDF viewers cannot configure these settings.

Solution 1Recommended

Use a Custom JavaScript Action for the PDF Hyperlink

Assign a JavaScript command to the link's 'Mouse Up' event to explicitly instruct the application to launch the URL in a new window.

The PDF specification does not support HTML-style target attributes (like target="_blank") for standard hyperlinks. The only reliable way to force a new window is by using the app.launchURL JavaScript method.

1
Select the Link Tool

Open your document in Adobe Acrobat. Go to the 'Tools' menu, select 'Edit PDF', and then click on 'Link' followed by 'Add/Edit Web or Document Link'.

2
Draw the link boundary

Click and drag a rectangle over the specific text or image that you want to serve as your clickable hyperlink. The 'Create Link' dialog box will automatically appear.

3
Configure the link action

In the dialog box, look under the 'Link Action' section. Choose 'Custom link' instead of 'Open a web page', then click 'Next' to open the Link Properties window.

4
Add a JavaScript trigger

Navigate to the 'Actions' tab. Click the 'Select Trigger' dropdown and choose 'Mouse Up'. Then, click the 'Select Action' dropdown, choose 'Run a JavaScript', and click the 'Add' button.

5
Input the script

In the JavaScript Editor window, type exactly: app.launchURL("https://www.example.com", true); (replacing the example URL with your intended destination). The 'true' parameter is what forces the new window. Click 'OK' to save.

Use a Custom JavaScript Action for the PDF Hyperlink
Software Compatibility: This JavaScript method requires the reader to use a dedicated PDF application (like Adobe Acrobat or WPS Office). Built-in browser PDF plugins may ignore custom JavaScript commands for security reasons.

Add and Edit PDF Links Easily with WPS Office

WPS Office features a powerful built-in PDF Editor that allows you to seamlessly add, edit, and manage standard hyperlinks in your PDF documents without needing complex software.

  1. 1. Open your PDF: Launch WPS Office and open the PDF document you wish to edit.
  2. 2. Access the Link Tool: Navigate to the 'Edit' tab on the top toolbar and click on the 'Link' button.
  3. 3. Insert the web link: Draw an area over your desired text or image. In the pop-up window, select 'Open URL' and type in your destination web address.
  4. 4. Save the document: Click the 'Save' icon to apply your hyperlink settings and export the updated PDF.
Easily insert and modify hyperlinks, page jumps, or file attachments directly within your PDFs.Fully compatible with standard Adobe Acrobat PDF formats.A lightweight, cost-effective alternative for professional PDF editing and management.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my PDF link still open in the same tab when viewed in Chrome or Edge?

Web browsers use lightweight native PDF viewers that intentionally block or ignore advanced PDF JavaScript commands like app.launchURL for security purposes. The script will only execute properly when the file is opened in a fully-featured PDF desktop application.

Can I make standard PDF links open in a new window without using JavaScript?

No, the PDF file format itself does not have a native setting equivalent to HTML's target="_blank". Using JavaScript with the 'true' parameter is the only built-in method to command a new window launch.

Will these JavaScript hyperlinks work on mobile devices?

Generally, no. Most mobile PDF viewers and apps disable JavaScript execution to protect the device from malicious scripts, meaning the hyperlink may fail to react when tapped on a smartphone or tablet.