Copy link to clipboard
Copied
I have successfully created a custom dynamic stamp with many custom Java script fields which pop up for you to enter the content which will be filled in to the stamp once placed
The whole sequence has 6 pop ups where you enter the information, then when i go to drop the stamp in place on the document it calls up the whole sequence again, entering all the info a second time. Once comepleted the second time, the content is all correct and you can place it into the document but how do i stop having to do the process twice?
Also, the custom stamp won't enter on some scanned document the first attempt - why would this be?
HELP!
Stamp scripts are called several times for different reasons. For example, they are called everytime any stamp in the same stamp file is displayed on the stamp menu, or when a preview for any stamp in the stamp file, as well as when the stamp is actually placed. To only display popups when the stamp is placed, the stamp script has to be properly qualified. It also helps to name the stamp properly.
You can read about it here:
https://acrobatusers.com/tutorials/dynamic_stamp_secrets/
https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm
...Copy link to clipboard
Copied
It's hard to say for sure without seeing the stamp file in question. If you can post it, we can take a look at it.
Copy link to clipboard
Copied
Thank you for replying.. post pictures or attach the stamp file itself?
Cheers!
Copy link to clipboard
Copied
Attach the stamp file.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Where does you check the stamp name?
Copy link to clipboard
Copied
Sorry, where does the stamp name? You mean what is the name in the file location?
Copy link to clipboard
Copied
Look at the link.
Copy link to clipboard
Copied
Stamp scripts are called several times for different reasons. For example, they are called everytime any stamp in the same stamp file is displayed on the stamp menu, or when a preview for any stamp in the stamp file, as well as when the stamp is actually placed. To only display popups when the stamp is placed, the stamp script has to be properly qualified. It also helps to name the stamp properly.
You can read about it here:
https://acrobatusers.com/tutorials/dynamic_stamp_secrets/
https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm
Copy link to clipboard
Copied
Hi Guys,
I have followed and read these and this isnt helping - the stamp is still popping up 2 times.
Copy link to clipboard
Copied
Have you changed the file?
Copy link to clipboard
Copied
Yes, i tried changing file and its name etc.
I got on to adobe chat support. I posted -
ME:
For each of the text fields, i have entered script into the custom calulcation script -
eg. this.getField("Date Received").value = app.response("Date Received:");
ADOBE:
So I was testing by creating the same stamp at my end, in case if we need to do something in the application to correct it. As after applying the script it does pop up twice.
When use the general event.value = util.printd(); script. It works okay
I tried to change the script as per above and it made the stamp pop ups not come up any more to input the fields.
The 6 seperate scripts in the stamp are:
this.getField("Date Current").value = app.response("Date Current:");
this.getField("Date Received").value = app.response("Date Received:");
this.getField("Cost Centre").value = app.response("Cost Centre:");
this.getField("Purchase Order Number").value = app.response("Purchase Order Number:");
this.getField("Budget Line Item").value = app.response("Budget Line Item");
this.getField("Amount").value = app.response("Amount");
Thanks in Advance!
Copy link to clipboard
Copied
You doesn't check the stamp name.
Copy link to clipboard
Copied
You are missing some key information. This article covers everthing you need to know:
https://acrobatusers.com/tutorials/dynamic_stamp_secrets/
Copy link to clipboard
Copied
In the "Stamp Secrets" article it explains that the stamp script needs to be qualified with a special event property and the stamp name, in order to only run when the stamp is placed. Read the artcle and follow the instructions.
Copy link to clipboard
Copied
Can you post the stamp code? We need to actually see what you are doing.
Copy link to clipboard
Copied
Thanks Thom, please see above!
Copy link to clipboard
Copied
Hi bobbieb56686240! Did you find the answer? I have the same question and have read through all of this! š
Copy link to clipboard
Copied
The solution is to properly qualify the script that display the stamp popup, so that it only displays when the stamp is actually being placed. The code for doing the qualification is discussed in these articles, take a look and let us know what part you do not understand:
For Members: https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm
Free : https://acrobatusers.com/tutorials/dynamic_stamp_secrets/
Copy link to clipboard
Copied
I cant find where I am going wrong:
Here is my Script:
if((event.source.forReal)&&(event.source.stampName == "#Contractors"));
this.getField("CO0210").value=app.response("Contractor #:");
this.getField("LN0210").value=app.response("Contractors Last Name:");
this.getField("CN0210").value=app.response("CLIENTS NAME:");
this.getField("INV0210").value=app.response("FULL INVOICE NUMBER:");
I have attached the file as well. Any help would be greatly appreciated š -Dena
Copy link to clipboard
Copied
Also, here is the stamp name:
templates
[object Template="#Contractors=WeeklyTimesheet"]
Copy link to clipboard
Copied
What happens when you use the stamp?
Copy link to clipboard
Copied
You have to enter through the cycle and then it appears to go through the cycle again for it to stick
Copy link to clipboard
Copied
You must test the stamp name.
Copy link to clipboard
Copied
There is an error in the script. Here's the correction. An "if" statment does not end with a semicolon, instead it is the start of a code block, which is delimited with curly brackets.
if((event.source.forReal)&&(event.source.stampName == "#Contractors"))
{
this.getField("CO0210").value=app.response("Contractor #:");
this.getField("LN0210").value=app.response("Contractors Last Name:");
this.getField("CN0210").value=app.response("CLIENTS NAME:");
this.getField("INV0210").value=app.response("FULL INVOICE NUMBER:");
}