Skip to main content
Known Participant
May 19, 2021
Answered

Dynamic Stamp Editable Text field

  • May 19, 2021
  • 1 reply
  • 1384 views

Good Morning, 

 

I do have the feeling that I am not very intelligent as I read through nearly every post that covers the topic of Dynamic Stamps and scripting.

 

In front of me I do have the book from Thom Parker - BUT I am not able to create the probably easiest stamp fild on earth. Fun fact, I managed to do a couple of years ago, but missed to save the script and the files.

 

So what have I done so far: 

 

Created the stamp I would like to have from an .eps (attached as .png)

Made a new Stamp from this file => this one is automatically entered in my Stamps folder (Mac). Than I gave it a new name "Buchhaltung.pdf". (and in Acrobat it has the same name and the same category name)

 

If I try to stamp with it, it works.

 

Now I would like to simple have the chance to enter values (as text) next to each field.

 

Therefore I open the PDF from the stamps folder and started to prepare a form.

 

Works great. The form fields are added automatically and I can enter the properies.

 

BUT whatever script I use (from all posts here), nothing happens? nothing. Acrobat is crashing, yes. And the file needs to be saved again asking for another location. But it does not work.

 

Shouldn't it be something like for the first field and respectively changed according the next field names:

 

if ((event.source.forReal)&&(event.source.stampName == "Buchhaltung")) { var cAsk = "Enter ER-NUMMER"; var cER-NUMMER = ""; event.value = app.response(cAsk, cER-NUMMER); }  

 

Maybe someone could help me please....I don't get it...

 

thx!

This topic has been closed for replies.
Correct answer try67

ok, I think I will give up... would you mind to help me out and let me know the script?

 

if ((event.source.forReal)&&(event.source.stampName == "#eYsqfchUk24Dutki_-O4SC"))

 

{ var cAsk = "Enter ER-NUMMER"; var cER-NUMMER = ""; event.value = app.response(cAsk, cER-NUMMER); }

 

what should be deleted or changed? 

 

 

 


The variable name with the hyphen in it, as I wrote before... In fact, you don't need variables at all for this.

Try this:

 

if (event.source && event.source.forReal && event.source.stampName == "#eYsqfchUk24Dutki_-O4SC") { 
	event.value = app.response("Enter ER-NUMMER:", "");
}

1 reply

try67
Community Expert
Community Expert
May 19, 2021

This is a common mistake. People think that the stampName property is the name of the file, or how it is called in the Stamp tool. It's not. It's an arbitrary string of characters that you can find out by applying the stamp to a page, then selecting it with the mouse and running this code from the JS console:

 

this.selectedAnnots[0].AP

 

Input the text that is printed to the console into your script and try again.

Known Participant
May 19, 2021

thanks try67!

 

so I found out the name - great!

 

and the script is at least giving a Syntax Error back?

 

try67
Community Expert
Community Expert
May 19, 2021

You can't use a hyphen in the name of a variable.