Copy link to clipboard
Copied
Want a script to do the following
- Search all pages in a PDF document -
- Every page should have a certain word or phrase based on user prompt in the Adobe Actions
- If a page does not have this word or phrase, then print a list of pages that does not have this word or phrase. - want script to this step.
- this code will be used from Adobe Action Wizard -
I have got script to search and mark the word or phrase only want help for doing the last thing, i.e to show the list of pages which doesnot contain the word/phrase searched for.
//HIGHLIGHTING COLOR
var colHilite = color.yellow;
var oDoc = event.target;
var aAnnts = oDoc.getAnnots({sortBy:"Author"});
for(var i=0;i<aAnnts.length;i++)
{
if(aAnnts[i].type == "Redact")
{
aAnnts[i].type = "Highlight";
aAnnts[i].strokeColor = colHilite;
}
}
Copy link to clipboard
Copied
Did you get my reply about the method you will need to use at the heart of the code you write, to get each word in turn?
Copy link to clipboard
Copied
I whould doblbe check your script. It appears to be serching the annotations within a PDF that are of the type "Redact" or redaction annotations and will be removed when Redaction is applied. This is not the same as searching for a word or string within the text of the PDF.
Copy link to clipboard
Copied
This code has nothing to do with what you described.
Copy link to clipboard
Copied
You can check every page with the parameter nPage of the method getAnnots.
Copy link to clipboard
Copied
Do you want the words to be highlighted?
So it looks like you have a 2 step process.
1) run a redaction search.
2) run a script to figure out which pages don't have the searched words.
Did you do this as an Action? This is the best way to do it.
So the script for #2 is tricky.
One way to do this is to use the annotation list to create a sorted list of page numbers onwhich the annots appear.
Then walk this list to create a list of numbers that do not appear in the first list.
Do you have any programming experience?
Copy link to clipboard
Copied
See my free abracadabraTools plugin : https://www.abracadabrapdf.net/utilitaires/utilities-in-english/abracadabratools_en/
And its "Deletes all pages without comments" function.
I just have to change a "!=" into a "==" in the script to made it "Delete all pages with at least one comment"
Should it be ok for you ?