Find and replace pages with part of a url
I've made a pdf of our colleges previous course catalog and for some reason it added links to pages outside of the path for the catalog. I need to search for pages that contain part of the url "/news" and delete them from the pdf. I've tried using a javascript, but nothing in the document is ever removed.
This is what I tried:
for (var p=this.numPages-1; p>=0; p--) {
for (var n=0; n<this.getPageNumWords(p); n++) {
if (this.getPageNthWord(p, n) == "/news") {
this.deletePages(p);
break;
}
}
}
