Copy link to clipboard
Copied
Having an issue when creating a dynamic stamp. I am entering in a custom javascript and select that when creating my form on the dynamic stamp. When I hit okay, it automatically sets it back to "Field not calculated" instead of keeping my javascript. I even made an error at first and it called that out, I corrected it and it seemingly won't let me have that script be entered. here is what I am entering
var cAsk = "Enter POI Number" ;
var cTitle = "POI Number: ";
if(event.source.forReal && (event.source.stampName == "#mH2CRwgU97QYytFkFHMANC"))
{
var cMsg = app.response(cAsk, cTitle);
event.value = cMsg;
event.source.source.info.exhibit = cMsg;
}
That error is from editing the stamp file, not from running it. It's not a problem, but if you want it to go away, then follow Try67's suggestion in his post at the bottom of the thread.
The stamp name is not the file name. The stamp name is part of the page template for the page that is the stamp.
Open up the "Organize Pages" tab and select the "More > Page Templates" menu item. You'll see the template name here.
You can also get the template name be placing the stamp on a PDF page, selec
...Copy link to clipboard
Copied
Try this:
Create a new field with this script.
Copy link to clipboard
Copied
The problem is with Acrobat, not the script. I've seen this when using an external editor for scripts. I think Bernd's idea is a good one. Try creating a new field and starting over.
Copy link to clipboard
Copied
Thanks guys, I did create a new field and finally got the script in there. Closed the form editing and saved, however, now I am not getting the script to run when I post the stamp. Prompts aren't showing up to enter in the values
Copy link to clipboard
Copied
Did you copy the stamp file the correct location?
Did you restart Acrobat after copying the stamp file?
Copy link to clipboard
Copied
I accessed the static stamp in the stamps folder within Acrobat and then added the scripting and saved it back in that folder within Acrobat. I did restart acrobat and even this morning just turning on my computer it is still not showing
Copy link to clipboard
Copied
Is the stampName correct?
Copy link to clipboard
Copied
Right I double checked that, and I am using the stamp name in the user stamps folder. I tried to recreate it so now I have a different stampName, seen below and this is where I am getting it from
var cAsk = "Enter POI Number" ;
var cTitle = "POI Number: ";
if(event.source.forReal && (event.source.stampName == "#biB4tIWRwdqM4zhdqaW_MC"))
{
var cMsg = app.response(cAsk, cTitle);
event.value = cMsg;
event.source.source.info.exhibit = cMsg;
}
Also, I noticed that the debugger pops up showing this message:
TypeError: event.source is null
3:Field:Calculate
I am not too sure how to remedy that or if that is the cause of it not showing up
Copy link to clipboard
Copied
That error is from editing the stamp file, not from running it. It's not a problem, but if you want it to go away, then follow Try67's suggestion in his post at the bottom of the thread.
The stamp name is not the file name. The stamp name is part of the page template for the page that is the stamp.
Open up the "Organize Pages" tab and select the "More > Page Templates" menu item. You'll see the template name here.
You can also get the template name be placing the stamp on a PDF page, selected it, and then running this code in the Console Window
selectedAnnots[0].AP
Copy link to clipboard
Copied
Oh man, yep that was it! Appreciate all the help guys
Thank you!
Copy link to clipboard
Copied
You can find everything you ever wanted to know about Acrobat Dynamic stamps here:
https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm
Copy link to clipboard
Copied
Change this line:
if(event.source.forReal && (event.source.stampName == "#mH2CRwgU97QYytFkFHMANC"))
To:
if (event.source && event.source.forReal && event.source.stampName == "#mH2CRwgU97QYytFkFHMANC")
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more