Skip to main content
AllanADL
Participant
May 4, 2017
Answered

How do I lock a lot of comments all at once

  • May 4, 2017
  • 4 replies
  • 10088 views

G'day

I have set up a PDF with over 200 comments in it and want to lock them so readers can't move them or delete them easily.  I can't see more than a few of them in the right hand side comment window in the tool ... there seems no way to see them all by just scrolling down. 

I found if I clicked on what is in the column and highlight each one the lock they all lock at once.  However if i highlight comment on the doc itself and then get a properties window it doesn't lock all the highlighted comments

Please help individually locking 200 comments is a bummer

Regards

Allan

Correct answer try67

Did you make sure to select the entire code before running it?

4 replies

robertt87769452
Participating Frequently
February 12, 2019

Hi,

I tried the javascript above and get an error message:

ReferenceError: annots is not defined

1:Console:Exec

undefined

Anything I have to change in the script to make this work?

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 12, 2019

Did you make sure to select the entire code before running it?

robertt87769452
Participating Frequently
February 12, 2019

Thanks, try67. That did it. I did not know you had to do that. You just saved me a lot of work!

Participant
May 8, 2017

You can do it very easily with any editor of your choice.

Thankink You

Zoya Khan

[ Mod: link removed ]

AllanADL
AllanADLAuthor
Participant
May 5, 2017

G'day again

Thank you guys for the help.  I especially appreciate your contribution Karl as I am a teacher without enough techie skills to attempt JavaScript.  I fumbled around the Action Script Wizard and eventually was able to add your script and run it.

It worked well and now all comments are locked.  One thing for your information and they might not be connected and I was able to work around it. It might help if you look at the document.  This is a new version of a learning and teaching poster/model that is now in 15 languages and the English Blooms Wheel has been downloaded from my blog 200,000 times in 18 months.  However this actual version is a 3mb PDF at http://bit.ly/PWTSposter

OK my practice is to build it in Keynote on a Mac and then export to PDF.  When I wanted to add 227 pop up comments I thought I would export at the highest quality settings and OPTIMISE or REDUCE afterwards.  Worked well but fortunately i copied everything so when I run the script on the highest graphic quality PDF (41 mb) then tried to optimise it fails.  The file will reduce but not optimise. I think it is the script because without it is all OK.

Not a problem because I can optimise first then run the script and that is the poster PDF in the link above.  Of course in the future I will set the lock as the default in the comments.

Again thanks for the help

Regards
Allan

Document Geek
Community Expert
Community Expert
May 5, 2017

This is easy, but you'll need to edit the comments in your favorite text editor. I'm going to refer you to a related article I wrote: How to Globally Change Font Size of Text in a PDF Sticky Note.​ The end result is different, but that article is well illustrated and should provide a bit more insight.

For your task, you need to:

  1. Export all the comments to a data file.
  2. Change the extension of the data file from FDF to XML.
  3. Open the data XML file in your text editor.
  4. Do a search for " Open true" and change it to "Open false"
  5. Save the XML file.
  6. Change the extension back to FDF.
  7. Back in Acrobat, delete all the comments.
  8. Import the FDF file you just edited.

Now all the comments will be locked.

try67
Community Expert
Community Expert
May 5, 2017

There's no need to edit the source code of the PDF. It can be done using a simple script in Acrobat.

Karl Heinz  Kremer
Community Expert
Community Expert
May 5, 2017

Try67 is correct, you can do this with just a few lines of JavaScript code:

this.syncAnnotScan();

var annots = this.getAnnots();

for (var i = 0; i < annots.length; i++)

  annots.lock = true;

You can run this e.g. in an Action, so that you can process multiple files at once.