How to Make PDF Hyperlinks Open in a New Window
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.

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

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. Open your PDF: Launch WPS Office and open the PDF document you wish to edit.
- 2. Access the Link Tool: Navigate to the 'Edit' tab on the top toolbar and click on the 'Link' button.
- 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. Save the document: Click the 'Save' icon to apply your hyperlink settings and export the updated PDF.

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.




