PDA

View Full Version : Calculating age from 6 fields



broughanb
02-07-2017, 10:25 PM
I need to auto calculate the age of a person with the following fields;
DOB: 19/05/1954 (dob_d/dob_m/dob_y) This is how I have named the fields.
DOD: 19/05/2017 (dod_d/dod_m/dod_y) This is how I have named the fields.
Age:(This is the field where I require the answer).
The information is in an editable pdf document and contained in 6 seperate fields, the answer to go in the seventh.
Can anyone assist with the java script required to obtain the age in a seperate field.
I would be grateful for any assistance.
I am using PDF Studio 11 Pro to produce the documents
Brian

Ember1205
02-08-2017, 10:42 PM
Seems you're trying to use a hammer to tighten a bolt.

In other words, you've got the wrong tool to do the job. Age calculation is better done by a spreadsheet, so you may be best suited to use AppleScript to read in the various values you're using to calculate the age, enter them into a formula in Numbers, read the result and then paste it into the PDF.