PDF Editing Issues

How to Batch Remove PDF Link Highlighting Using JavaScript

Steven ParkerSteven Parker Nov 3, 2026 869 views

Question details

The user needs an automated method to eliminate the inverted highlight effect from all internal links within a large PDF simultaneously.

How to Batch Remove PDF Link Highlighting Using JavaScript
Product
Adobe Acrobat / PDF
Device & OS
not provided
Scenario
Working with a large PDF document containing numerous internal links that currently display an inverted highlight upon selection.
Observed behavior
Links exhibit an inverted highlight effect when clicked, and manually changing the highlight mode for each individual link is highly inefficient.
Before you start

Always save a backup copy of your PDF document before running any document scripts to prevent accidental data loss or irreversible formatting changes.

Solution 1Recommended

Use the Acrobat JavaScript Console for Batch Removal

Execute a short JavaScript snippet to loop through all pages and set the highlight mode of every link annotation to 'None'.

This method utilizes the built-in JavaScript console in your PDF editor to automate the process of modifying link properties, completely bypassing the need to right-click and edit each link's appearance individually.

1
Open the JavaScript Debugger

Launch Adobe Acrobat, open your PDF file, and press Ctrl + J (Windows) or Cmd + J (Mac) to open the Acrobat JavaScript Debugger Console.

2
Paste the Code Snippet

Clear any existing text in the console window and paste the following script: for (var p = 0; p < this.numPages; p++) { var box = this.getPageBox('Crop', p); var links = this.getLinks(p, box); if (!links || !links.length) continue; for (var i in links) { links[i].highlightMode = 'None'; } }

3
Execute the Script

Highlight all the pasted code with your mouse, then press Ctrl + Enter (Windows) or Cmd + Enter (Mac) using your numeric keypad to execute the script.

4
Save the Document

Go to File > Save or press Ctrl + S to save the document and permanently apply the new link highlight settings.

Use the Acrobat JavaScript Console for Batch Removal
Script Execution: Once executed successfully, all link highlights across all pages will instantly be set to invisible, providing a cleaner interactive experience.
Edit PDF Links

Manage and Edit PDF Links Easily with WPS Office

WPS Office provides a highly intuitive PDF editor that lets you quickly add, edit, or customize links in your documents without needing to work with complex JavaScript code.

  1. 1. Open your PDF: Launch WPS Office and open your PDF document containing the links you want to modify.
  2. 2. Access the Edit Tab: Navigate to the 'Edit' tab located on the top ribbon menu to reveal the PDF editing tools.
  3. 3. Select the Link Tool: Click on the 'Link' button. This will highlight all currently active and clickable areas within your document.
  4. 4. Modify Link Properties: Right-click the specific link you wish to modify, select 'Properties', and adjust the appearance settings such as highlight style or border thickness.
Easily edit PDF link properties visually via a user-friendly interface.Fully compatible with standard Adobe PDF formats and annotations.Lightweight software with fast PDF processing and comprehensive editing tools.
QA img-9

Frequently Asked Questions

Why do PDF links display an inverted highlight when clicked?

By default, many PDF viewers use an inverted, outlined, or inset highlight mode to provide immediate visual feedback to users, confirming that a hyperlink or button has been successfully clicked.

Will running this JavaScript affect my text highlighter annotations?

No. The script specifically targets the 'highlightMode' property of interactive link annotations retrieved via 'getLinks()'. It does not interact with or alter text markup tools like standard highlighting, underlining, or strikethroughs.

How do I open the JavaScript console if the keyboard shortcut doesn't work?

If the shortcut fails, you can manually open the console by navigating to Tools > JavaScript > Document JavaScripts in the top menu, or by searching for 'JavaScript Debugger' in your application's tool search bar.