Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to Delete all the comments from a PDF File

New Here ,
Feb 27, 2020 Feb 27, 2020
Can somebody help to know if there is a way to delete all the comments from a PDF in a single go?
 
I have some 1000+ PDFs, those have too many comments, i want to delete it in 1 go for each file.
 
May be i can try building a bot for that after then.
 
Please help
 
Thanks in advance
TOPICS
How to
12.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Feb 28, 2020 Feb 28, 2020

This code will remove all the comments from a file:

 

this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
	for (var i=annots.length-1; i>=0; i--) {
		annots[i].destroy();
	}
}

 

If you have Acrobat Pro you can use it in an Action and process multiple files in a single process.

 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2020 Feb 27, 2020

That's possible using JavaScript and can be automated with Acrobat. I know that code that does this has been posted in these and other forums, but post again if you can't find anything with a search.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2020 Feb 28, 2020

This code will remove all the comments from a file:

 

this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
	for (var i=annots.length-1; i>=0; i--) {
		annots[i].destroy();
	}
}

 

If you have Acrobat Pro you can use it in an Action and process multiple files in a single process.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 02, 2022 Apr 02, 2022

Where do I insert this code, I need direction on how and where to install this code, please

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 10, 2022 Jun 10, 2022

I went to 1. More Tools - and found the "Action Wizard" and opened it up for the doc I am working on.  2. At the top of the page I found "New Action" and chose that.  Once the box opened on the right side I chose the circle with a cross (new action) and did a cut and paste of the code above there.  NOTHING HAPPENED. 

So I tried a second route. 1. I went to the top of the page and chose "New Custom Command" 2. once the box popped up I scrolled down and chose "Execute JavaScript"  3.  When the box popped up I did a cut and past of the code in there.  NOTHING HAPPENED.  So I am not sure where you are posting this script but I have spent far too long trying to fix this document that I needed to submit yesterday!  So frustrating.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 10, 2022 Jun 10, 2022

Did you add a Save command?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 10, 2022 Jun 10, 2022

Yes of course I did.  I ended up going into the original M. Word doc and went through all the comments there.  The previous person who worked with the file did not clean it up properly.  When I saved it this time to a pdf it saved cleanly.  So it was carried over from the Word file. Who knew?  I wonder if this would work in reverse for those who need to elimate the comments.  1. Save as a Microsoft Word doc 2  Go into "review"  to accept or reject all comments.  3. Then save it again as a PDF.  Worth a try.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 04, 2023 Aug 04, 2023
LATEST

I wonder if this would work in reverse for those who need to elimate the comments.  1. Save as a Microsoft Word doc 2  Go into "review"  to accept or reject all comments.  3. Then save it again as a PDF.  Worth a try.

Did your wonder work?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines