Copy link to clipboard
Copied
Is there a way to batch remove all annotations of PDFs in a given folder?
thanks.
Copy link to clipboard
Copied
You can use this JavaScript code as a part of an Action (if you have Acrobat Pro) to achieve it:
this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
for (var i=annots.length-1; i>=0; i--) {
annots[i].destroy();
}
}
Copy link to clipboard
Copied
You need to also add a Save command, as I've mentioned before.
Copy link to clipboard
Copied
Hi there,
Thanks for reaching out. As described above, you want to remove the annotations from the PDFs in a folder.
Do you have Adobe Acrobat Reader DC (Freeware) or Adobe Acrobat DC (Subscription based)?
If you have Adobe Acrobat DC, you may use the Action Wizard Tool to remove the annotations from the PDFs in a folder. You can also create your own actions. You can access and manage the actions by clicking Tools > Action Wizard.
For more detailed information please use the help article here (https://helpx.adobe.com/in/acrobat/using/action-wizard-acrobat-pro.html#run_an_action)
Let us know how it goes.
Regards
Amal
Amal
Copy link to clipboard
Copied
Thanks. This works one by one from within a folder and requires a lot of manual intervention. I do have Acrobat DC Pro, but also have thousands of PDFs in a folder.
Copy link to clipboard
Copied
You can use this JavaScript code as a part of an Action (if you have Acrobat Pro) to achieve it:
this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
for (var i=annots.length-1; i>=0; i--) {
annots[i].destroy();
}
}
Copy link to clipboard
Copied
Thanks for this. I am really not sure how to create an action and add it to the A. Wizard.
Also, is "this" meant to be replaced by a value (ie a folder name)?
Copy link to clipboard
Copied
- Read this: https://helpx.adobe.com/acrobat/using/action-wizard-acrobat-pro.html
- No! Do not edit the code in any way.
You'll just need to add a command to save the file after the one that executes the script.
Copy link to clipboard
Copied
I just realized how to add this to Actions. But the script likewise obliges manual intervention for each file's deletions. Is there a way to get around manual intervention too? ("Any" seems necessary; I used the script without modification.)
Copy link to clipboard
Copied
Tick off the "Prompt User" check-box under the commands you add to your Action, and no user interaction will be required.
Copy link to clipboard
Copied
Thanks. did that. It is asking me to Save each PDF as it gets modified and appears on the screen. Is there no way to have this run in the background unattended?
Copy link to clipboard
Copied
What options did you select under the Save command?
Copy link to clipboard
Copied
It's erratic. It runs through a few files, then posts the prompt:
Then it goes on and repeats the pattern. If I say No it interrupts. It could be that some of these files were already altered on a previous batch of attempts, where I did say Save. Not sure now. (I'm using a copy of a folder for the trials)
Copy link to clipboard
Copied
What exact command did you add?
Copy link to clipboard
Copied
Just the action named delete folder annotations with this Java Script:
Copy link to clipboard
Copied
You need to also add a Save command, as I've mentioned before.
Copy link to clipboard
Copied
Got it. That is working. It's not superfast, but it is running unattended (with the exception of one PDF (so far) that wants to be printed; I say No/Cancel, and it goes on running and completes the job). No idea how long it will take to run through thousands of PDFs but I can try that next.
Copy link to clipboard
Copied
The print dialog appears because there's code embedded in that file that opens it when the file is opened, most likely.
Acrobat is not really built for processing thousands of files in a single process. You might have to do it in batches.
Copy link to clipboard
Copied
OK, thanks for all the help. At least I have a foundation to try with. much obliged.
Copy link to clipboard
Copied
For others who are looking to batch remove annotations of PDFs in a folder and don't have Acrobat DC Pro or don't want to mess with scripts, BatchPurifier is a 3rd party GUI tool that can do that out of the box.
Copy link to clipboard
Copied
I know this was a long time ago, but if you are stilling looking for a simpler solution and are using a microsoft product I created an application that can easily do this by simply selecting the folder in your folder browser

