Deleting Pages Containing A Specific String Using this.getPageNumWords()
I have been trying to delete a particular page using the following script provided by Acrobat JS aficionado Karl Heinz Kremer. This code is in the mouse up event of a button. The text "HW2019-02" is searchable on the page (not an image and not a field value).Unfortunately, I just cannot get it to work. Does anyone have a fix for this?
for (var p=this.numPages-1; p>=0; p--) {
for (var n=0; n<this.getPageNumWords(p); n++) {
if (this.getPageNthWord(p, n) == "HW2019-02") {
this.deletePages(p);
break;
}
}
}
Thank you in advance
