I would like to be able to delete several pages at the same time using
this method i.e to delete page X contains the word 3A and the page X+1
contains the word 3B.
You need to add more cases to the part of the script that checks if the word exists:
if (this.getPageNthWord(p, n) == "3A") {
this.deletePages(p);
break;
}
else if (this.getPageNthWord(p, n) == "3B") {
this.deletePages(p);
break;
}
Because there is some overhead in actually getting the word, you may want to get it only once and then use a variable in your actual comparison:
var theCurrentWord = this.getPageNthWord(p, n);
if (theCurrentWord == "3A") {
this.deletePages(p);
break;
}
else if (theCurrentWord == "3B") {
this.deletePages(p);
break;
}
Also instead of to look through all the document and find the specific
word(s), is it possible to point a section on it and then to look for
the word(s)?
Not with JavaScript. You can select a word, but you cannot get the word that is currently selected.
Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com