5 Replies Latest reply on May 15, 2017 12:45 PM by try67

    Find and replace pages with part of a url

    stevevoltmer

      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;

              }

          }

      }