Skip to main content
AlanB00
Participant
October 26, 2019
Answered

I need to change the stamp ID on thousands of PDF documents; one known stamp ID to another known one

  • October 26, 2019
  • 1 reply
  • 454 views

I am trying to do a mass change of thousands of PDF documents by changing the ANNOTS value of a stamp from value A to value B.

 

Example: I am updating the copyright data or contract number in a stamp.

I can find the value for the selected stamp in the test file by

this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
for (var i in annots) {
var annot = annots[i];
if (annot.AP=="#aI3Pm6PnqekSnIcRvvaIsB") annot.AP="#Aq8vmGycg7pPDLe3sFSf-B";
}
}

 

yielding a value
#XKLrjSOhC9tXY2XpCh8wIC

I can change the value of the stamps....

two stamp values shown

#aI3Pm6PnqekSnIcRvvaIsB
#Aq8vmGycg7pPDLe3sFSf-B

 

this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
for (var i in annots) {
var annot = annots[i];
if (annot.AP=="#aI3Pm6PnqekSnIcRvvaIsB") annot.AP = "#Aq8vmGycg7pPDLe3sFSf-B";
}
}

 

But I don't know how to automate this to open all the files in a folder then change the ANNOTS value and save then next file

any help or suggestions would be appreciated

Thanks,

Alan

 

 

 

    This topic has been closed for replies.
    Correct answer try67

    If you have Acrobat Pro you can use an Action to execute this script on multiple files.

    You'll find it under Tools - Action Wizard, if you have Acrobat Pro DC, for example.

    1 reply

    try67
    Community Expert
    try67Community ExpertCorrect answer
    Community Expert
    October 26, 2019

    If you have Acrobat Pro you can use an Action to execute this script on multiple files.

    You'll find it under Tools - Action Wizard, if you have Acrobat Pro DC, for example.