These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Creating Custom Dynamic Stamps

Raybob
Registered: Feb 28 2007
Posts: 5
Answered

Hi, I've been following Thom Parkers guide to creating dynamic stamps but I'm stuck and I would really appreciate some help, please.

I am following the procedure to create the stamp as per the instructions given by Thom and I can get all the scripts to work except one (the one I really want!)
What I cannot seem to be able to do is to get the user entry script to work.
I can replicate it using the StampSecrets-Sample #3 example, even deleting the existing fields, then extracting and saving it as a new file, recreating it as a stamp and reinserting the scripts, but when I try to do this using my own stamps, it just won't work and I'm tearing my hair out! Where am I going wrong?

Thanks ever so much.

Bob Friendship.
South West UK

Bob Friendship, 59, Acrobat enthusiast since ver 3. Living in SW England

My Product Information:
Acrobat Pro 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Can you post the calculation script you are using for the fields on your own stamp? Or better yet, can you post the stamp file?

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Raybob
Registered: Feb 28 2007
Posts: 5
Thanks for your reply, Thomp. How do I post you the Stamp from here?

Bob Friendship, 59, Acrobat enthusiast since ver 3. Living in SW England

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
raybob wrote:
Hi Thomp,
well here's the script copied from your Dynamic Secrets Sample #3 but I've altered the stamp name to that of my pdf stamp, created before placing the script. The stamps name is Ledgercrp. It has just the one form field. I will need to alter the script as all I want to type in the Java window in a cheque number, and a bonus would be to encorporate two tick boxes, but I've not discovered if this can be achieved.

var cAsk = "Enter One of: Approved, Rejected, or In Process" ;
var cTitle = "Document State For Stamp ";
if(event.source.forReal && (event.source.stampName == "#Ledgercrp"))
{
var cMsg = app.response(cAsk, cTitle); cMsg += " : " + util.printd("mm/dd/yyyy", new Date()); event.value = cMsg;
event.source.source.info.DocumentState = cMsg;
}
Please re-read the article. Specifically the section on acquiring the internal name of the stamp. It's this name that needs to be used in the script, and it's not obvious.

And yes, check boxes or any other field type can be incorporated into the dynamic stamp.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script