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!
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
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.
Copy link to clipboard
Copied
If you have accidentally run OCR (Optical Character Recognition) on an image and want to selectively delete comments in a PDF, you can follow these steps:
Open the PDF in a PDF editor: Use a PDF editor like Adobe Acrobat or Foxit PhantomPDF to open the PDF.
Open the comments panel: Locate and open the comments panel in the PDF editor. The comments panel will show all the comments that have been added to the PDF.
Select the comments to delete: Use the comment selection tool to select the comments that you want to delete. You can hold down the Ctrl key to select multiple comments.
Delete the selected comments: Once you have selected the comments, right-click and choose "Delete" to remove them from the PDF.
Save the changes: After you have deleted the comments, save the changes to the PDF.
By following these steps, you can selectively delete comments in a PDF to undo accidental OCR. However, keep in mind that this will only remove the comments and will not undo the OCR process itself. If you want to remove the OCR text from the PDF, you will need to use a PDF editing tool with OCR functionality to revert the changes.
Copy link to clipboard
Copied