Copy link to clipboard
Copied
Hello everybody, I'm new to using Adobe Acrobat and I'm very confused. I want to convert an old timesheet made in Excel into a fillable form in Adobe Acrobat. This calculation must demonstrate the number of hours between a starting time and an ending time, in short the employee will fill in their overtime, 6:35pm - 7:55 = 1.2h. Currently I managed to do this using the following script: event.value = - ( this.getField("start1").value - this.getField("end1").value) However, this pdf is sent already filled out to be signed through a flow, which sends it to email, it is signed by Adobe Acrobat Sign, and the result is coming in the wrong way. Result in the image.. 1- result when filling out
2-result adobe sign![]()
Can anyone help me with this, any ideas would help, thank you.
Copy link to clipboard
Copied
When an existing AcroForm (regular PDF form) is sent for signatures, the regular form fields are flattened out. Only fields with the Adobe Sign markup names are preserved. So prefilling works for sending a regular AcroForm for signatures.
Now you need a script for calculating the time difference.
This thread provides two variations on one method:
Copy link to clipboard
Copied
The result is wrong anyway. 22:55 - 21:35 is 1 hour and 20 minutes, which is 1.33 hours.
Times are very different from regular decimal numbers, and have to be handled differently.
You'll find a very large number of posts here on time difference calculations that provide a variety of methods for peforming this type of calculation.
The other problem is about number representation. Ignore this. If you get the time calculation correct, then the values in the fields will be text, so number formatting will not affect the display.
Copy link to clipboard
Copied
Also, scripts stop working when you convert the file to Acrobat Sign. You can't have both things working at the same time. Switch to regular digital signatures if you want your calculations to work.
Copy link to clipboard
Copied
Thanks for the answer.
If I fill it out first, what is the best script for this? This way, the document would already be filled in (webB) with the starting and ending times. Then it could be converted to the already completed ABsign, only being reviewed and signed.
Could this be an alternative?
Copy link to clipboard
Copied
When an existing AcroForm (regular PDF form) is sent for signatures, the regular form fields are flattened out. Only fields with the Adobe Sign markup names are preserved. So prefilling works for sending a regular AcroForm for signatures.
Now you need a script for calculating the time difference.
This thread provides two variations on one method: