Copy link to clipboard
Copied
Dear all, hope you are good and safe,
could someone help me with the following?
after making a markup PDF with many comments, I want to run a script to search and delete just the empty comments (empty sticky notes, rectangles, circles). what I found until now is the following, but this removes everything.
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
What do you mean by "empty", exactly? No attached comment text? If so, you can do it by changing this:
annots[i].destroy();
To this:
if (annots[i].contents=="") annots[i].destroy();
Copy link to clipboard
Copied
What do you mean by "empty", exactly? No attached comment text? If so, you can do it by changing this:
annots[i].destroy();
To this:
if (annots[i].contents=="") annots[i].destroy();
Copy link to clipboard
Copied
Amazing! thanks so much!

