Copy link to clipboard
Copied
Hello,
While working on a PDF in Adobe Acrobat on a series of scanned documents, I accidentally ran the OCR scan. There is now 4800 comments that slow and crash Adobe when I try to naviaget or add any new markups. I have also added bookmarks that I don't want to lose or have to redo as they had to be added manually. I tried using the Remove Hidden Information tool, but then all the bookmarks were lost and it doesn't seem like there's a way to just select the comments/markups. Is there a workaround?
Thanks!
Try running this code (from the JS Console, or a Custom Command):
this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
for (var i=annots.length-1; i>=0; i--) {
var annot = annots[i];
annot.setProps({lock: false, readOnly: false});
annot.destroy();
}
}
Copy link to clipboard
Copied
As far as I know, OCR doesn't add comments. Can you post a screenshot of the comments?
Copy link to clipboard
Copied
I believe what I did was run the OCR scan when I accidentally tried to search the document. In doing so this happened:
The document is a piping and instrumentation diagram so there are now about 4800 of these, and since the author is AutoCAD (i.e. the program used to draft the diagram) it seems like I can't click the first -> scroll to the bottom and shift click -> press delete.
Copy link to clipboard
Copied
Edit: turns out the comments are on the original documents. Of the 60 pages of diagrams 12 of them have these comments. Remove Hidden Information does not work, even on the individual un-edited files.
Copy link to clipboard
Copied
Open the Comments panel, click into the Comments List, press Ctrl+A to select all the comments, then press Delete to remove them all.
Copy link to clipboard
Copied
I did try this, but since the comments are imported from the software used to draft the diagrams (it appears as if the author of the comments is AutoCAD) I am not the author and as such can't delete them.
Copy link to clipboard
Copied
That's not the issue. You don't need to be the author of a comment to be able to delete it.
It's more likely they are locked. After selecting them all, right-clicking one of them and then select Properties and if the Locked check-box is ticked untick it, then try deleting them again. Even if it's unticked, tick it, then untick it, and try to delete them.
Copy link to clipboard
Copied
Still no luck, even ticking and unticking it.
Copy link to clipboard
Copied
Try running this code (from the JS Console, or a Custom Command):
this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
for (var i=annots.length-1; i>=0; i--) {
var annot = annots[i];
annot.setProps({lock: false, readOnly: false});
annot.destroy();
}
}
Copy link to clipboard
Copied
Be advised the above will delete ALL comments in the file, though.
Copy link to clipboard
Copied
Thanks so much for the code snippet, I think it will doe xactly what I'm looking for. However I also need to ask can I run JavScript scripts on Acrobat Standard? Or do I need pro?
Copy link to clipboard
Copied
Yes, you can use the JS Console for that.
Copy link to clipboard
Copied
Hello again,
I was able to borrow a copy of Pro from one of my coworkers and got the script to run - worked great and did exactly what I needed, thank you so much.