Copy link to clipboard
Copied
Hello,
i try to create a dynamic stamp which shows the Date and the Username of the Current User or the signature.
Acrobat does have a stamp like this in the examples, but i can't change them. I know that this is only possible with a calculated java-script.
The date i get with this code:
Event.value = util.printd("h:MM tt, MMM dd yyyy", New Date);
But i can't find any solution for a username (embedded in this and i don't know any java-script-specialist.
I hope you can help me.
Thanks and have some nice christmas days!
Copy link to clipboard
Copied
First of all, your code for the date is not correct. You've added capital letters when you shouldn't have.
Do you want to include the username in the same field as the date, or separately?
Copy link to clipboard
Copied
You should copy the code from one of the built-in dynamic stamps. For example:
event.value = (new Date()).toString();
AFDate_FormatEx("h:MM tt, mmm dd, yyyy");
event.value = "By " + ((!identity.name || identity.loginName != (event.source.source || this).Collab.user) ? (event.source.source || this).Collab.user : identity.name)
+ " at " + event.value;
Copy link to clipboard
Copied
Thanks - where did you get the "original Code" from the built-in stamps? I did not find them, although nothing with Google (maybe because i searched in german, because we are in Germany)
But this code doesn't Show the Username:
Copy link to clipboard
Copied
I went to the Stamps folder of the application (the exact location depends on your OS and Acrobat version), then opened the Dynamic.pdf file and copied the calculation script from one of the stamps that has the user name in it.
Copy link to clipboard
Copied
Even if i copy a built-in stamp and create a new one with the same code, it
doesn't work.
Can you try this with your System, too?
Copy link to clipboard
Copied
There might be an error when you apply the code to the field, but when you apply the actual stamp it will work. I tested it myself and it worked fine.
Copy link to clipboard
Copied
Happy new year!
We tried it again with the original stamps and it doesn't work even if we
change nothing.
We open the original stamp in Acrobat in Acrobat Professional it looks like
this:
(foozle is not our username)
If we go to the Code, go to edit menu to see the code and apply without any
changes, the stamp looks like this:
We change nothing and it doesnt work.... if we use the original stamps, the
username is always displayed.
The original code is:
event.value = (new Date()).toString();
AFDate_FormatEx("h:MM tt, mmm dd, yyyy");
event.value = "By " + ((!identity.name || identity.loginName !=
(event.source.source || this).Collab.user) ? (event.source.source ||
this).Collab.user : identity.name)
+ " at " + event.value;
Can we change anything to make it work? May there be a problem with Adobe
Versions? Maybe with the installed language?
I have no idea....is there maybe a special support user / contact for such
a problem? Maybe someone can use teamviewer to see what happens in our
system?
Thanks a lot for your support!
Copy link to clipboard
Copied
I might be able to offer you such help privately, for a fee. If you're interested you can contact me via try6767 at gmail.com. Just to clarify, though, I'm not an Adobe employee.
Copy link to clipboard
Copied
I used the code and it show the time and date but doesn't show my identity. Help if you can. Thanks.
Copy link to clipboard
Copied
@magnusm27477433 Mark.Thomas.FIN@gric.nsn.us
The below code worked for me and my team. Code courtesy of a popular chatbot.
var userName = identity.name;
var formattedDateTime = util.printd("h:MM tt, mmm dd yyyy", new Date);
var displayText = "By " + userName + " on " + formattedDateTime;
event.value = displayText;