7 Replies Latest reply: Nov 5, 2014 5:53 PM by C_D_F RSS

    Calculation Lag - Can't Acrobrat Pro handle 500  fields??

    C_D_F Community Member

      I have an 8 page pdf form with just under 600 fields in it created in Adobe XI Pro.

       

      It's an order form with 185 line items, with each line having 3 fields: a hidden 'Cost' field, visible 'Qty' field and a read only 'total' field which calculates the product of Cost x Qty.

       

      Under those 185 lines there is a 'subtotal' field (calculating the sum of all the 185 total fields above it), then a 'GST' field with a custom script calculating 10% of the 'subtotal' field, then a 'Grand Total' field calculating the sum of the SubTotal and GST fields.

       

      The form also has normal text fields, drop down lists and radio buttons for user information and payment details and buttons for submit via email, reset and print.

       

      All fields are in proper tab order and the Calculation fields are in the correct order (Forms>Tasks>Other Tasks>Set Field Calculation Order) and all fields calculate properly in real time. But there's a 2-3 second lag (showing the adobe hour glass/calculator icon as mouse pointer) when tabbing out of ANY field.

       

      Is this because acrobat forms cannot handle more than 500 fields in 1 document?? (I ask this because when trying to import the form into Forms Central, it said it can't import because the form has more than 500 fields). Or is there something else going on here?

       

      I've googled the lag issue and searched the adobe forums, but the only answer I can find is to check the Field Calculation Order, which I obviously have, and the thread stops there as that was the problem for that user. I couldn't find an answer where the fields were in order (like mine) with extra conversation about it.

       

      Surely I'm not the only person to have an order form with 185 items and 500+ fields in a form.

       

      Any adobe experts able to shed light on this?

       

      Thanks

        • 1. Re: Calculation Lag - Can't Acrobrat Pro handle 500  fields??
          MichaelN Community Member

          This may help:

           

          Button with JavaScript Action crashes Acrobat

           

          You can turn off the Edit > Preferences > Forms > Automatically adjust tab order when modifying fields.

          • 2. Re: Calculation Lag - Can't Acrobrat Pro handle 500  fields??
            C_D_F Community Member

            Thanks for the suggestion Michael, but that didn't help either.

             

            And this is a local setting, not a setting that saves with the document, which means - if it worked - you would have to tell every person you sent the form to, to go into their settings and turn this feature on/off before filling in the document.

             

            Cheers

            • 3. Re: Calculation Lag - Can't Acrobrat Pro handle 500  fields??
              Gilad D (try67) CommunityMVP

              From my personal experience it's possible to have that many fields, but

              you're testing the limits of the application, really.

              I don't know if the issue is the poor memory handling process of Acrobat or

              what, but working with files with a lot of form fields (especially on a few

              pages and with a lot of calculations) can be very frustrating and

              time-consuming.

              One thing that you can try is to move all the calculations to a single

              location, ie not have a custom calculation script for each field that

              calculates its value but a single script (for example, the calculation

              script of the total), that first calculates the values of each row, assigns

              it, and then does the total calculation.

               

              Remember that each time you make a change in *any *field in the file you're

              triggering all of the calculation scripts in all of the fields, which can

              take a while.

              • 4. Re: Calculation Lag - Can't Acrobrat Pro handle 500  fields??
                C_D_F Community Member

                Thanks for your input Gilad.

                 

                Gilad D (try67) wrote:

                 

                From my personal experience it's possible to have that many fields, but

                you're testing the limits of the application, really.

                 

                8 pages is testing the limits? What am I paying for then??

                 

                I don't know if the issue is the poor memory handling process of Acrobat or

                what, but working with files with a lot of form fields (especially on a few

                pages and with a lot of calculations) can be very frustrating and

                time-consuming.

                 

                Yes to both but that's what the form needs. What's frustrating is paying for something that doesn't do what it advertises.

                 

                One thing that you can try is to move all the calculations to a single

                location, ie not have a custom calculation script for each field that

                calculates its value but a single script (for example, the calculation

                script of the total), that first calculates the values of each row, assigns

                it, and then does the total calculation.

                 

                Not sure what you mean by this. First I'm not using custom calculation scripts. I'm using the inbuilt 'Value is the...' section on the Calculate tab on each line. I'm only using Custom Calc Script in the one field, the GST field, to do a division calculation as 'Value is the...' doesn't do division.

                 

                Secondly, I'm having to do a calculation on each line as it shows the total for that line, eg 2 of a $5 item shows total of $10, then next line could be 3 of a $10 item to show $30 etc, so I don't understand what you mean by 'move all calculations to a single location'. How can a single script show individual lines? Can you explain this a bit further or give me an example? What I tried changing just now was to do a hidden sub total at the bottom of each page, then have the actual Sub Total field at the end do a sum on those 7 fields instead of all 185 fields at once. This didn't help either.

                 

                Remember that each time you make a change in *any *field in the file you're

                triggering all of the calculation scripts in all of the fields, which can

                take a while.

                 

                Yes I know but like I said this form requires a total on each line, all 185 of them. Can Acrobat not handle this??? And when you say "calculation scripts', do you actually think I'm using individual Calc scripts are you putting 'Value is the...' in the same 'basket' as a Calc script?

                 

                Cheers

                • 5. Re: Calculation Lag - Can't Acrobrat Pro handle 500  fields??
                  Gilad D (try67) CommunityMVP

                  The issue is not with the amount of pages, but with the amount of fields, and mostly, calculated fields.

                   

                  And it doesn't matter if you use a custom calculation or the built-in command. Finally they're all scripts that have to be executed each time a change is made to any field.

                   

                  The single-script suggestion basically means you will have one field that has a custom calculation script associated in it. You can use that script to calculate the values of other fields as well. This makes it easier to make more efficient code and to control the field calculation order directly.

                  It's not a very simple task, though, if you don't know how to write JS code for PDF files.

                  • 6. Re: Calculation Lag - Can't Acrobrat Pro handle 500  fields??
                    GKaiseril CommunityMVP

                    The JavaScript in the PDF is not complied into machine code like a computer language is but the code is read and processed each time the script is called. Also each time a field has to be opened and processed there is some overhead processing the array of fields with calculations and opening each field. As suggested putting all the code in on field removes this overhead. Also using functions to perform a repeated task also requires less process and if the function is at the document level, there is some preprocessing that is not repeated the next time the function is called.

                     

                    Sometimes processing can be improved by locating some code in the actions for a field, especially is this code only needs to be processed when one exits the field, a validation is an example of this type of action.

                     

                    You really need to study the JS API reference to learn how the various actions are triggered and the MDS JavaScript reference to learn about the features of JavaScript that can help avoid some coding. For example there is a filter feature for arrays than can quickly remove values from an array without having to process the array through a for loop.

                    • 7. Re: Calculation Lag - Can't Acrobrat Pro handle 500  fields??
                      C_D_F Community Member

                      Thanks for the detailed explanations on how it works/calculates in the background. Looks like I have to learn javascript now. I wish the adobe rep told me this when I rang and asked if this was the right s/ware to do this type of job. They told me sure it has inbuilt functions that help you do this easily...