Link to home
Start Free TrialLog in
Avatar of coma12
coma12Flag for United States of America

asked on

500 pts. Making text field show 2 weeks ahead of current date

Hello,

I have a text field in an acrobat 6 file called "today" and I want it to show 2 weeks ahead of the current date in MM/DD/YYYY format. Below is a solution given to me by khkremer. Can anyone add to this answer or give me another solution?

-----------------------------------------------------------
select the Form tool: "Tools>Advanced Editing>Forms>Text Field Tool" and draw a rectangle on your PDF document. This will bring up the preference dialog for this form field. Select the "General" Tab and specify "Today" as the field name. Look around on the UI, select all the tabs, but you don't need to make any more changes here. Close the dialog. Select "Advanced>JavaScript>Document JavaScript". Give the script a name (e.g. "OnOpen") and click on the "Add" button. Replace the complete function stub with this line:

this.getField("Today").value = "today's date";

Save the file, close it and reopen it. YOu will now have the string "today's date" in your field. This information plus the first link that I provided should get you started with adding date information to your documents. You can have multiple fields with the same name. This will then add the date to all of these in one operation.
-------------------------------------------------------------
Here is the link khkremer  made reference to, though I cannot make heads or tails of it.
https://www.experts-exchange.com/questions/21003596/Acrobat-custom-calculation-javascript-date-difference.html

Your help on this is greatly apprieciated!

coma12
Avatar of coma12
coma12
Flag of United States of America image

ASKER

Here is a link to the pdf that I want to add the 2 weeks from current date text field to. The date is manually added right now, every day - ugggh.
http://www.reedh.com/newsletter/NewsletterOrderForm050427.pdf

Also if I will need to make the date in red.

thanks,

coma12
Were you able to add the text field to the document as I suggested in your earlier question?
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coma12

ASKER

khkremer,

Thank you so much!!!

I was hoping you were scanning the acrobat section.

Once again you came through like a champ and saved the day!

coma12