开发者

Today's Date in an Adobe Form

开发者 https://www.devze.com 2023-04-01 03:38 出处:网络
I\'m using Acrobat X Pro and would like my form to open with today\'s date.I am having a hard time finding a script that works in Acrobat X.Appreciate any help.

I'm using Acrobat X Pro and would like my form to open with today's date. I am having a hard time finding a script that works in Acrobat X. Appreciate any help.

I found this response by Paque in July 2010: Remove your script and replace it with the following document javascript:

var f = this.getField("wells_datefield"); if (!f.value) f.value = util.printd ("m/d/yyyy", new Date()); Save your form and open it, and the date should pop right in there.

When making the document javascript, remember to not put it inside a function. One way of doing that is the following. In the Acrobat menu:

Advanced->Document Processing->Document Javascripts... In the dialog that pops up, enter a Script Name (for instance "populate_date") and click Add... In the script dialog that pops up: REMOVE everything ("function populate_date(){}") and paste in the script above. Click ok, then Close. Save the form, close it and reopen it. There is no step 6! :>

I don't have the option of Advanced - 开发者_运维问答Document Processing .....

9/2: Hi there.. is there something else I can say that might help explain my problem more effectively?


You need to add the JavaScript tool...When you click Tools there is a small menu icon with a down arrow next to it.. Click and select JavaScript. It will load the toolset..


I know this is a late response for this question. Here is a way to get this script to work properly. This script is used to automatically input the date that is on your computer each time you open this pdf. The script that you have:

var f = this.getField("wells_datefield"); if (!f.value) f.value = util.printd ("m/d/yyyy", new Date())

is stating that the date field is called 'wells_datefield' The date format will be m/d/yyyy. You can change the way the date is shown by changing the format such as d mmmm yyyy. To enter this script in your pdf, do the following actions.

  • Click the 'Page Thumbnails' icon on the left side. It is an icon with two sheets of paper.
  • Right click the mouse on the thumbnail of the page
  • Click 'Page Properties'
  • Actions tabSelect Action’ drop down list
  • Select ‘Run a JavaScript’
  • Click ‘Add’ button
  • Type the script from above
  • Click 'OK'
  • Click 'OK'
0

精彩评论

暂无评论...
验证码 换一张
取 消