These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Inserting calculations into fields

marthamontour
Registered: Jan 21 2008
Posts: 16

I found the most recent class with Lori very useful as this is the first time I have worked in Acrobat and am presently on trial with Professional 8.1.

The forums are very useful also.

I had a 7 page form, for the first 2 pages the field calculations worked. The size of the file went from 200 KB to over 4000 KB

When I got to page 3 & 4 which have at least double or triple the calculations of the first 2 pages, I could not longer insert formulas and information would appear in a form that I could not remove. My computer froze and Adobe Acrobat stopped responding.

I wound up seperating the document into 2 pages each. I was able to format field caculations into pages 1-2 and 7, pages 3-4 have no calculations while 5-6 have some calculations but with some of the same difficulties as 3-4.

I was wondering what the problem could be: my computer is not powerful enough or is there something else that can be done?

Martha

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This is very unusual, but not unheard of. It's possible that you have an infinate loop or some kind of recursion in your calculations. This doesn't explain the size increase, which may not be relevant to the issue, but it would explain the performance problem and Acrobat crashing. What exactly is it that you are trying to do? Are there other scripts on the form, ones that are not in the calculation events?

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

marthamontour
Registered: Jan 21 2008
Posts: 16
The form is downloaded from a government site and is for calculating child support. What is a finite loop or recursion? How would I detect it? I could send you the forms. Let me know. I have Adobe Acrobat Professional 8.1.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
So did you add the calcuations? Or were they already there. If you did add the calculations, please explain how you did it, and when the file bloat and performance problems started to happen.

You can send the form to JavaScript [at] acrobatusers [dot] coman infinate loop is a code loop that repeats itself forever, or until Acrobat crashes. Recursion is when a form event triggers other events that in turn trigger the first event, in effect causing an infinate loop.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

marthamontour
Registered: Jan 21 2008
Posts: 16
I will send all the forms to the javascripts e-mail.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I can't see anything that's horribly wrong with the PDF. I didn't have any problems adding or changing calculation scripts. The file bloat was because you've been doing a lot of "Saves". Try doing a "SaveAs", it'll knock the file size down real fast.

There were a couple of issues that need to be fixed. First, it's a really bad idea to use special characters or white space in field names. There were a few with "%" in them. You also have unprotected divide by zero calculations. These calcuations cause annoying popups to the user when nothing is obviously wrong.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

marthamontour
Registered: Jan 21 2008
Posts: 16
Thanks for your time. I will try your suggestions and let you know if they resolve my problem.