Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Dynamic Stamp with Username

New Here ,
Dec 20, 2018 Dec 20, 2018

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!

16.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2018 Dec 20, 2018

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2018 Dec 20, 2018

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;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 20, 2018 Dec 20, 2018

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:

2018-12-20 18_18_16-IBM Notes Antwort_ WG_ Re_ [Acrobat Reader] – Dynamic Stamp with Username [Viren.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2018 Dec 20, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 20, 2018 Dec 20, 2018

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 21, 2018 Dec 21, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 03, 2019 Jan 03, 2019

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 04, 2019 Jan 04, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 29, 2020 Jul 29, 2020

I used the code and it show the time and date but doesn't show my identity. Help if you can. Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 26, 2023 May 26, 2023
LATEST

@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;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines