Skip to main content
ronc60059835
Participant
July 17, 2018
Answered

Problem creating a custom dynamic stamp with date

  • July 17, 2018
  • 1 reply
  • 11105 views

TDLR: Custom stamp shows my image but not leaves off the dymanic date that I created.

-----------
I was attempting to create a custom stamp.  My goal was to build a "Received" stamp where I designed a .png file and left some room in the middle of the image for where I would later put the text file.  I used instructions from here Create a custom dynamic stamp using Acrobat DC

I create my new custom stamp with the background image I designed and then close.  I then browse to users/myusername//library/application support/adobe/acrobat/dc/stamps and I see the new PDF file there.

I edit this PDF and using the forms tool, I create a text field where the dynamic date will go. Everything worked great for this portion of the task.  I was able to get the stamp to display the date using the javascript sample provided.  It shows that the date appears in the text box appropriately. 

After you complete this step, the instructions tell you to save the PDF.  This is where I run into my first issue.  The dialog box does not allow me to simply save the file as it lies in that directory.  I'm not sure if this is because this folder is hidden/protected or whatever. 


To work around this, I save this PDF elsewhere and then copy it back over to users/myusername//library/application support/adobe/acrobat/dc/stamps successfully.

I then open up a random PDF file to experiment and go to add my stamp.  It puts the image part of the stamp out there but it doesn't generate the dynamic date.

This topic has been closed for replies.
Correct answer Karl Heinz Kremer

Don't know how you came up with this script, but there are a couple of problems with it - you should however get something in your field (even though the time will be wrong). Try this:

event.value = util.printd("mmm dd yyyy h:MMtt", new Date());

If you are still not getting anything. Make sure that this script is used as a calculation script. You can get confirmation that the script is actually running by adding this line to the script (either before or after the one line from above):

console.println("Dynamic stamp calculation script");

You should then see this line being printed on the JavaScript console (you open it with Ctrl-J or Cmd-J).

1 reply

Karl Heinz  Kremer
Community Expert
Community Expert
July 18, 2018

What script did you use fir the stamp?

A while ago, I wrote some instructions about how to modify one of the Acrobat dynamic stamps: Modify Dynamic PDF Stamps in Acrobat - KHKonsulting LLC

ronc60059835
Participant
July 18, 2018

I used several different versions that I found in examples and they all produced this result above.  This is what I'm using in the latest one.

event.value = (new Date()).toString(); AFDate_FormatEx("mmmm dd yyyy h:mmtt");

Karl Heinz  Kremer
Community Expert
Karl Heinz KremerCommunity ExpertCorrect answer
Community Expert
July 18, 2018

Don't know how you came up with this script, but there are a couple of problems with it - you should however get something in your field (even though the time will be wrong). Try this:

event.value = util.printd("mmm dd yyyy h:MMtt", new Date());

If you are still not getting anything. Make sure that this script is used as a calculation script. You can get confirmation that the script is actually running by adding this line to the script (either before or after the one line from above):

console.println("Dynamic stamp calculation script");

You should then see this line being printed on the JavaScript console (you open it with Ctrl-J or Cmd-J).