Just commenting on the last paragraph: Definitely NOT in individual fields (because of the way the field event processing sequence in Acrobat works). Therefore, if the recalculation should happen regularly (meaning with every change of some field contents in the document), the script would be in the Calculate event of a hidden, readonly field, otherwise not involved in the whole calculation. If the recalculation should happen only at specific events (pageOpen, documentOpen, etc.), it should be attached to that event. Document-level function or in field? Definitely define a document-level function, which can be called from the field. As it has been mentioned, the Document-level function is interpreted once, and then available for whenever it is called, it will be faster than if it had to be interpreted every time the script gets called. Additional ways to speed up: • instead of doing the calculations in many field rows, manage the data in a 2-dimensional array, and only when the calculations are done, refresh the fields from the array. Note that arrays can not be stored in the file but only strings (or streams), which means that you will have to concatenate the arrays into strings when you are saving (at latest), and recreate them when opening the file. • while field values are processed, and especially if fields are shown or hidden based on that processing, suppress the refresh by embracing the part of the script with this.delay = true and this.delay = false. • to suppress excessive useless recalculations, suppress them by embracing the part of the script with this.calculate = false and this.calculate = true, followed by this.calculateNow to force the recalculation. Hope this can help.
... View more