RE:Imprimir fecha del sistema en pdf
Publicado por
kla (1 intervención) el 25/11/2004 23:38:26
To create an automatic date field:
1.Select the form tool ,and create a text field. Select the General tab and name the field Today .
2.Select the Format tab,choose Date for the format category,and choose a month,day, and year format option (for example,“mmm d,yyyy ”).On the General tab,make sure the field is read-only because it will be a calculated field,and click Close .
3.To create a document level script that is executed each time the document is opened,
choose Advanced >JavaScript >Document JavaScripts .Name the script Today and
click Add .
4.Delete the automatically generated text,defining a Today function,that is displayed in the script window.Type in the following text in the exact format (line wraps are OK)and click OK .
var f = this.getField("Today");
f.value = util.printd("mm/dd/yyyy", new Date());
This script binds the Today field to the variable f and then calculates the value.The new Date() expression creates a new date object initialized to the current date and time.The util object is used to format the date into the month/day/year format.
5.Click OK in the JavaScript Edit dialog box,and then click Close in the JavaScript Functions dialog box.
Notice that the date is displayed in the format you selected for the text field,not in the format produced by util.printd
SALUDOS