Copy link to clipboard
Copied
Needing to stamp mutiple files at once in the right top hand corner. If someone can write a JavaScript code for that for me.
Or is there a way to stamp batches in XI
whatever works TIA
Missing Closing curly brace.
this.addAnnot({type:"Stamp", page:0, AP:"#DbN0yA0FJHMzRGruq212tA", rect:[560,740,560,740]});
Copy link to clipboard
Copied
My stamp name is #DbN0yA0FJHMzRGruq212tA
Copy link to clipboard
Copied
You can do it using the addAnnot method as a part of an Action.
If you want help with the code you'll need to provide additional information such as the exact coordinates for the stamp, and on which pages it should appear.
Copy link to clipboard
Copied
Hello, My stamp name is #DbN0yA0FJHMzRGruq212tA and I would like it in the top right hand corner. I am trying to get the stamp on multiple PDF files all at once. So, just the first page stamped of eachfile on the top right hand corner.
Copy link to clipboard
Copied
How big do you want the stamp to be?
Copy link to clipboard
Copied
it is a stamp I already have made under dynamic stamps
Copy link to clipboard
Copied
I'm aware of that, but the script can't know what's the size of the stamp. It applies it at whatever size you tell it to.
So if you tell me what size it is I could help you write the code to add it using that size. Otherwise I can't help you.
Copy link to clipboard
Copied
If you apply the stamp to a point, rather than a rectangle, then it takes on it's natural size. So you can just pick a point near the top right corner.
this.addAnnot({type:"Stamp", page:0, AP:"#DbN0yA0FJHMzRGruq212tA", rect:[560,740,560,740]|);
Copy link to clipboard
Copied
I am getting this error:
SyntaxError: syntax error
1:Console:Exec
undefined
Copy link to clipboard
Copied
Missing Closing curly brace.
this.addAnnot({type:"Stamp", page:0, AP:"#DbN0yA0FJHMzRGruq212tA", rect:[560,740,560,740]});
Copy link to clipboard
Copied
@Thom Parker Could you please elaborate on the placement of the Stamp. I have this exact situation. throught this thread i was able to find a line that works for me:
addAnnot({type:"Stamp",page:0,AP:"#MyCustomStamp1", rect:[100,400,100,100]});
but am not abe to fully control the placement. So I need that the Stamp comes in a specific coordinate and with its Natural size and always on the "upright" orientation, regardless of the orientation of the stamped PDFs
Thank you in advance.
Copy link to clipboard
Copied
Finding the right placment point is just working out the math.
Read this article:
https://www.pdfscripting.com/public/PDF-Page-Coordinates.cfm
To compesate for page rotation, add the "rotate" parameter to the "addAnnot" function call to set the stamp rotation to the page rotation.
this.addAnnot({type:"Stamp",page:0,AP:"#MyCustomStamp1", rect:[100,400,100,100]}, rotate:this.getPageRotation(0));