Skip to main content
Participant
March 8, 2021
Answered

Locking text boxes within a pdf

  • March 8, 2021
  • 2 replies
  • 6692 views

Hi there. I need to lock multiple text boxes within a pdf document. The document has over 600 pages and there are 4405 text boxes. I know that in theory I can lock all by going to Tools/Comments/Open then selecting all the comments, right click and tick Locked but the document is so big that it crashes when I try to do this. Even scrolling down the list of comments to highlight prior to right clicking them all takes ages and then results in a Not Responding message. Any tips for a pain-free way to do this, please?

 

Correct answer try67

Assuming you mean Text Box comments you can do it using this script:

 

this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
	for (var i in annots) {
		var annot = annots[i];
		if (annot.type=="FreeText") annot.setProps({lock: true, readOnly: true});
	}
}

2 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 8, 2021

Assuming you mean Text Box comments you can do it using this script:

 

this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
	for (var i in annots) {
		var annot = annots[i];
		if (annot.type=="FreeText") annot.setProps({lock: true, readOnly: true});
	}
}
Eric Dumas
Community Expert
Community Expert
March 8, 2021

Hi,

Can you include a screenshot and a description of what you would like to achieve at the end.

Are you trying to manage comments, text fields of a form,...?

Lynne AAuthor
Participant
March 16, 2021

Hi there. I haven't been able to share a screenshot, sorry. I'm basically trying to lock all the annotations that have been added to a pdf document so they can't be moved around the page. The issue I'm having is that when I try to select all the text box comments the document starts to crash every time as it's so big. I  don't have javascript editor so can't use the scripts offered as solutions. Most of the text boxes are already locked so I basically need an esay way to select only those that are unlocked so I can then lock them en masse but I can't figure out how to do this. If I filter by author/reviewer etc. it's still too big and keeps crashing.

Thanks

try67
Community Expert
Community Expert
March 16, 2021

If you have Acrobat then you have a JavaScript editor. Press Ctrl+J to display it.

Then paste the code into it, select it all and press Ctrl+Enter to run it.