Skip to main content
Participant
February 17, 2023
Answered

Remove copied text from highlights without deleting the highlights

  • February 17, 2023
  • 2 replies
  • 1580 views

Copied selected text from highlights is an excellent feature of Adobe Acrobat. And yet, it creates duplicated texts when extracting this type of highlights using other applications. I wonder if there is an automated way to delete the copied text from all highlights (that is, deleting the text that appears in the comment section when the "copied selected text" feature is activated) without removing the actual highlights. I also wonder if someone has developed a JaveScript to do this. Any help would be most appreciated. 

 

 

This topic has been closed for replies.
Correct answer try67

You can do it using this code:

 

this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
	for (var i in annots) {
		annots[i].contents = "";
	}
}

2 replies

JR Boulay
Community Expert
Community Expert
February 17, 2023

The simplest would be perhaps not to create these texts:

 

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 17, 2023

You can do it using this code:

 

this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
	for (var i in annots) {
		annots[i].contents = "";
	}
}
Participant
February 17, 2023

Many thanks, @try67! This is the exact piece of code I was looking for. I very much appreciate your help with this.