Copy link to clipboard
Copied
Acrobat DC Pro on Win 10 Pro.
I have created a dynamic stamp and called the file "Receipt.pdf". I want to use it to signify that my invoice has been paid by my client.
There are two text fields, one above the other, the first to show the current date and the second field I want to generate a dialogue for me to insert particulars of the payment, e.g., a cheque number or other identifier.
When I apply the stamp to the pdf invoice, the date field works fine, but no dialogue is generated. So the stamp appears with the current date and a blank space beneath it.
The "custom calculation script" for the date field is:
event.value = (new Date()).toString();
AFDate_FormatEx("dd mmm yyyy");
The script for the dialogue field is:
var cAsk = "Enter Receipt Details" ;
var cTitle = "Receipt Details" ;
if(event.source.forReal && (event.source.stampName == "#Receipt"))
{
var cMsg = app.response(cAsk, cTitle);
event.value = cMsg;
event.source.source.info.exhibit = cMsg;
}
I am ignorant about javascript and have merely done my own research and followed other examples which seem to work. Would some kind person please help me to get that dialogue field working properly? Any advice will be much appreciated, but please keep it simple!
The file name is not the stamp name.
Copy link to clipboard
Copied
You must use the correct stamp name:
https://acrobatusers.com/tutorials/print/dynamic_stamp_secrets
Copy link to clipboard
Copied
Thanks for your reply.
I have deleted the stamp and re-created it to get an original file name, which is OG3txYF8ow2Bqq3sCWTXoD.pdf.
The script is now:
var cAsk = "Enter Receipt Details" ;
var cTitle = "Receipt Details" ;
if (event.source.forReal && (event.source.stampName == "OG3txYF8ow2Bqq3sCWTXoD"))
{
var cMsg = app.response(cAsk, cTitle);
event.value = cMsg;
event.source.source.info.exhibit = cMsg;
}
However, the result is still the same as originally described.
Copy link to clipboard
Copied
The file name is not the stamp name.
Copy link to clipboard
Copied
Bernd, thanks for your very prompt replies.
I have to say that I found that "Secrets" article, which I had read many times before coming to this forum, to be very obscure and difficult to follow. Maybe it is clear to those who are familiar with javascript, but not to me. It does not make clear the distinctions between the file name in the "Stamps" folder and the file name given by the user in Acrobat on creation of the stamp and the stamp name. It could also make clear how you actually "run" the code to disclose the stamp name. I tried many ways to run the code and nothing happened. When I googled how to run it, and then actually ran it, everything became clear.
My problem is now solved. Many thanks, Bernd, for your help.