Copy link to clipboard
Copied
I am trying to create an action that will place the standard Acrobat “Approved” dynamic stamp in the same place and same size every time the action is run. I am having a hard time finding the stamp. I have tried using the code below but I'm just not getting a return that gives me the right information to add to the script.
app.getPath("user", "stamps"); // Show location of custom stamps
app.getPath("app", "stamps"); // Show location of built-in stamps
This will need to be shared among several users, so the script needs to pull the stamp from each user’s computer. Is this possible and how can I achieve it.
Below is exactly what I need, except I need to replace the arrow button with the Approved stamp. It needs to be the dynamic name/date/time Approved stamp.
Thanks in advance.
Tina
var inch = 72;
for (var p = 0; p < this.numPages; p++) {
// Position a rectangle (.5 inch, .5 inch)
var aRect = this.getPageBox( {nPage: p} );
aRect[0] += 1.5*inch;
aRect[2] = aRect[0]+1*inch;
aRect[1] -= .78*inch;
aRect[3] = aRect[1] - 18;
// Now construct a button field with a right arrow from ZapfDingbats
var f = this.addField("NextPage", "button", p, aRect )
f.setAction("MouseUp", "this.pageNum++");
f.delay = true;
f.borderStyle = border.s;
f.highlight = "push";
f.textSize = 0; // Auto-sized
f.textColor = color.blue;
f.fillColor = color.ltGray;
f.textFont = font.ZapfD
f.buttonSetCaption("\341") // A right arrow
f.delay = false;
}
As far as the second part of your question goes, adding a stamp (or a different annotation) is very different from adding a form field. Take a look at the Doc.addAnnot() method: Acrobat DC SDK Documentation
This code will add the Approved annotation in a fixed location:
this.addAnnot({
type: "Stamp",
page: 0,
rect: [36, 72, 288, 144],
AP: "#DApproved"
});
Copy link to clipboard
Copied
You don't need to know where the stamp is located, all you need is the name of the stamp. You get that by placing the stamp in question on a page, then select that stamp and run a one-line JavaScript on the JavaScript console. See here for more information: https://acrobatusers.com/tutorials/dynamic_stamp_secrets - scroll down to the section titled "Stamp Name".
Copy link to clipboard
Copied
i am trying to create a new dynmaic stamp
called Denied
I need the date and time and my user name to appear
i got the date working just not the name
i need step by step i am new to this
Copy link to clipboard
Copied
i am trying to create a new dynmaic stamp
called Denied
I need the date and time and my user name to appear
i got the date working just not the name
i need step by step i am new to this
Copy link to clipboard
Copied
The best way for you to do this is to copy stamp code from an existing Dynamic stamp. First find one of the built-in stamps that has what you want.
Then read these:
There are several articals on this topic here:
And you'll find more info in this forum thread
How to change the name on a Dynamic Stamp copied from the defaults?
Copy link to clipboard
Copied
As far as the second part of your question goes, adding a stamp (or a different annotation) is very different from adding a form field. Take a look at the Doc.addAnnot() method: Acrobat DC SDK Documentation
This code will add the Approved annotation in a fixed location:
this.addAnnot({
type: "Stamp",
page: 0,
rect: [36, 72, 288, 144],
AP: "#DApproved"
});
Copy link to clipboard
Copied
Thank you Karl, this is exactly what I needed! It looks like I was making it more difficult than it needed to be.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now