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

Calculations not saving in PDF

belicious
Registered: Jul 6 2009
Posts: 18

Hi,

I'm a newbie at creating acrobat forms and need a little help if possible. I have created a form in Acrobat 8 Professional (MAC OS 10.4), the calculation is very simple and based on Qty (Field name: A1) x Unit Price (Field name: B1) = Amount (Field name: D1) there are 5 lines of this. The next calculation is the 5 'Amount' fields which = Total. I have used both the "Value is..." and the the "Simplified Field Notation" to create the calculations and they both work fine on my computer but once saved and reopened they stop functioning. I need to be able to create the calculation, save the file and send it to my client so they can use the functioning form complete with calculations in tact. Is this possible?

Thanks in advance for your help.
Kind regards
Bel.

My Product Information:
Acrobat Pro 8.1.2, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Are the calculations completely wiped out or do you mean they are still there but stop working? If the calculations are not there at all when reopened then the file is not being saved. Have you checked the time stamp on the file? Are other changes saved?

All calculations are converted into JavaScript under the covers, so if the calculation are there and not working you can check the console window to see if there are any reported problems. Open the console from the "Advanced > Document Processing > JavaScript Debugger..." menu item.Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

belicious
Registered: Jul 6 2009
Posts: 18
Hi Thomp, Yeah the calculations are still there, just not working. All other changes save. I opened the console, this is the message that sits in the bottom box, not sure that it's indicating any errors?...

Acrobat EScript Built-in Functions Version 8.0
Acrobat Annotations / Collaboration Built-in Functions Version 8.0
Acrobat Annotations / Collaboration Built-in Wizard Functions Version 8.0
Acrobat Multimedia Version 8.0
Acrobat SOAP 8.0

Any further advice?

Thanks
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
These are the normal entries in the console from when Acrobat starts up and runs all its own internal scripts. So there's no reported problems.

It's entirely possible that your calculations are in error. The Acrobat JavaScript operating environment is created specifically for each document. While the doc is open this environment is persistent and saves every object that's created. So it's possible for you do several rounds of code entry and have everything working only because of objects that were created early in the session. Then when you reload the PDF nothing works. Since you're using the Simplified Notation a lot of this is going on behind your back.

One of the most common failures in Simplified notation is the field names. They have to be all letters and numbers with no spaces or notation. So the calculation you've outlined in your first post

Qty x Unit Price = Amount

Should be placed in the "D1" field and look exactly like this

A1 * B1

Is this the case? Just to isolate things, remove all formatting from the fields and any thing else that might affect the values of the fields.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

belicious
Registered: Jul 6 2009
Posts: 18
Hi again,

My calculation was in D1 and similar but it had brackets around it, ie (A1 * B1) (I had seen it like that in a tutorial) I have removed the brackets, and removed the formatting and other calculation (ie. total - Field name E1) to isolate the problem, saved and reopened - and still not saving my calculation. Checked the console and it still looks the same. There are a lot of other fields in this file like name, date, ABN, address, phone etc, all named correctly, these don't have any calculations etc, do I need to get rid of them too so we can figure out the problem?

Thanks.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Before you go that route do this, just as a sanity check. Create a new form and add only the three field to it. Add in your calculation. Make sure the field names are correct.

If this doesn't work then something is terribly wrong. But the likelihood is that something else on the form is interfering with the calculation. It's imposible to tell without deleting things one at a time until it works or you've reached the minimum. Before you start deleted field, save a special testing version of the form to work on.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

belicious
Registered: Jul 6 2009
Posts: 18
Hi Thom, Sorry for the delay. That worked on it's own. Next step?...
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ok then, something on your form is interfering with the calculation. It's time to start deleting stuff.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

belicious
Registered: Jul 6 2009
Posts: 18
Hi again Thom,

It's been a while since I've worked on this file but I eventually got through introducing the fields one by one. All of them work on a blank background but when I introduce the working feilds to the background template designed in Indesign (containing the clients branding graphics) the calculations stop working at that point. I have all of the elements converted to curves, what else can I do to stop them interfering with the fields?

Hope to hear from you soon.

Kind regards
Bel
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There is absolutely nothing that the graphics on the page can do to interfere with the calculations. There is something else going on when you add the background graphics. What you are doing is very simple stuff. There should not be any problems.

How are you adding the graphics? Are you copying the form fields? doing a replace page?

At this point I'm guessing, I'd have to look at the form to tell you anthing else. I'd proabably only take me a few minutes to fix it. But, I don't do free form work and I'm on vacation for 2 weeks starting tomorrow. The only thing I can suggest is that you get professional help. Anyone who knows PDF forms could fix you up in a very short time.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

buzzmonkey
Registered: Mar 4 2008
Posts: 40
I seem to be having the same problem, but I had one field with a $ symbol and the other didn't, when I put $ symbols on all 3 fields the calculation worked or if I took it off all 3 fields the calculation worked, but If I put a $ symbol on 1 and not on the multiplier then it didn't work....
belicious
Registered: Jul 6 2009
Posts: 18
Hi Thom,

The process I have used to create the background graphics is also simple and is as follows:

1. Create Indesign Artwork for background (header and footer with logo etc.)
2. Export as a high res print ready pdf
3. Open pdf in Acrobat Professional
4. Enable usage rights
5. Copy working fields from blank form
6. Calculations work, save file, close file
7. Open file and fields stop working...

I understand that you are on vacation for 2 weeks, so don't expect a response straight away. I don' know a professional in this area so if there is anyone that you can refer or anyone who would like to help, please contact me.... willing to pay - I just need this sorted my client is nagging :(

Thanks
Bel
belicious
Registered: Jul 6 2009
Posts: 18
PS Buzzmonkey, I have $ in all fields so unfortunately not the solution here. Thanks though.
buzzmonkey
Registered: Mar 4 2008
Posts: 40
Hi Guys,

I am in exactly the same boat as Bel.
Create file in indesign, create pdf from that file, form fields work fine when tested, then change to enable user rights, resave and all calculations stop working.

This is driving me crazy...

Thanks all :)
belicious
Registered: Jul 6 2009
Posts: 18
Still looking for someone to help me out with my file... is there any one out there that offers a acrobat forms service? as I mentioned I'm willing to pay for this to be fixed....

Thanks.
buzzmonkey
Registered: Mar 4 2008
Posts: 40
Belicious, I have just received a file from someone else that works...even though the calculations are exactly the same as mine...I cannot find any difference yet mine once user rights have been enabled seems to cancel out the calculation, I am going to make a dummy form with no other form fields to see if it is another field that is corrupting the calculation. will keep you posted...
Swen
belicious
Registered: Jul 6 2009
Posts: 18
buzzmonkey, when I create my form on a blank page (no background) even with usage rights enabled it works, the problem seems to occur when I transfer my working fields into the file with a background :( I'm not sure our circumstances are exactly the same - close though... Keep me up to date with the progress though.
buzzmonkey
Registered: Mar 4 2008
Posts: 40
Ok I just did the same thing...used the same indesign file, created a pdf from that file and only used the 3 fields and it didn't work....so even though they said the graphics have nothing to do with it, it seems to be the only explanation, I am truly stumped. somehow I don't think my client would like the document without the design...haha
I have posted also on the adobe website, so I will keep at it.
Cheers
Swen
buzzmonkey
Registered: Mar 4 2008
Posts: 40
test 2
I just created a blank page from indesign with no graphics on it at all, and still happened.
So it has something to do with files created from indesign......
This is all too hard, why couldn't I have been an astrophysicist instead, would have been much easier..haha
smitchell15 (not verified)
Hi Belicious, please feel free to email the form over if you are still struggling and i will inspect it for you. I do alot of forms for my company and I'm an ACI in Acrobat and InDesign so hopefully should be able to solve it for you?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ok guys I'm back from break. I don't know exactly the problem but the number 1 thing that struck me was the reader enabling. This is the absolute last thing that should be done to the form. Everything else should be on the form and working first. After the form is reader enabled there should be no other changes made to the form. If changes need to be made, then they should be made to the original unenabled form. So here are some questions to move things along.

Do the calculations work in a non-enabled form. i.e., create PDF from InDesign, Add fields, Add calculations.

If this all works after the form has been saved and reopened then apply the Reader enabling and save to a different file name so that the original is kept untouched.

Let me know how that goes.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

buzzmonkey
Registered: Mar 4 2008
Posts: 40
Hi Thom,

Thanks for the response, we are still stumped, I have also posted on the adobe forum and you can see some different tests we have done there.

I just created the form as you suggested, and the form works perfectly, then I save, close, re-open and it still works, so it is only when we enable user rights that we seem to be having problems with the calculations not working.

Thanks again
Swen
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ok, I've seen some odd problems with enabling but not this one. Can you post two versions of the form somewhere that it can be downloaded, such as www.acrobat.com (in the share app). One enabled and one not-enabled.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

buzzmonkey
Registered: Mar 4 2008
Posts: 40
Sure thing, or did you want me to email them to you???

I'll create the file again from scratch.

Thanks again
Swen
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Unless the form is propietary, just posting it to the share site is good.

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

buzzmonkey
Registered: Mar 4 2008
Posts: 40
I think I just worked it out......

When creating the forms for you Thom I created the 3 fields, then saved the file.
Then I opened that file and enabled user rights before checking the fields. and it seemed to work.
On the previous forms, I was creating the form fields, then checking them with variables to make sure all was working, then enabling user rights and the calculations stopped working. does this make sense to you???

Cheers
Swen
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
That makes no sense at all:~{ But the good bit is that it seems to be repeatable. I'd still like to take a look at the forms if you can post them.

Did you ever look in the console window to see if any errors were reported?


Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

buzzmonkey
Registered: Mar 4 2008
Posts: 40
Hi Thom,

I have uploaded two files to acrobat.com shared files, I have never used that before so is there anything you need to be able to find them???

The Thomp_test_EUR.pdf is the one that for some reason worked yesterday and the
Thomp_test_EUR2.pdf is the one that before I clicked enable user rights I checked the calculation to see if it was working.

Cheers
Swen
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Actually it helps if you post a link to the files. They are in your account and you have control over the access.

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

buzzmonkey
Registered: Mar 4 2008
Posts: 40
Here you go.

https://share.acrobat.com/adc/document.do?docid=4106cea6-c8f3-4b5e-9719-3166a953dbfe

https://share.acrobat.com/adc/document.do?docid=fb83ad09-088a-4381-a228-da8321f4c4d2

Cheers
Swen
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Both of the forms work just fine for me. I'm not seeing any problems. Also, both forms have been Reader Enabled. It's near impossible to examine a document for issues after it's been Reader Enabled, which is why I asked for a version that was not Enabled.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

buzzmonkey
Registered: Mar 4 2008
Posts: 40
Hi Thom,

Yes both of those forms are Reader enabled, but that is because the first one works for me and the seonond one doesn't, so I thought you could see if there was a difference.

Also the forms only seem to stop working for me when user rights have been enabled.

Here is a new one with no user rights activated.

https://share.acrobat.com/adc/document.do?docid=534d012c-b7ee-4948-9062-7618598b9b4f

Thanks again for the help
Cheers
Swen
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There is nothing wrong with this file that I can see. It works just fine, even after I enabled it. The same is true for the other files you posted. Have you asked anyone else to test the files you created? Or have you only tested them on your own system? Have they been tried in Reader?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

buzzmonkey
Registered: Mar 4 2008
Posts: 40
Hi Thom,

They have been sent to the client and they have come back and said they didn't work.
Then I opened them on my system and indeed they didn't work.
I am at a loss as to why this seems to be happening on my system and my clients only.

So the calculations work in the total field on all 3 pdf files I supplied???
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, I didn't have a single problem. All three forms are very basic. Only three fields and one standard calculation. I can't imagine that anything could go wrong with it. Try doing the calculation with JavaScript

event.value = this.getField("Field1").value * this.getField("Field2").value;

I forget the actual field names.

Also, please look in the console window and see if there are any problems reported.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

dude91
Registered: Sep 15 2009
Posts: 1
This thread has surely taught me a lot ! I will try it out on my site [url=http://bannedfunnycommercials.com/]Funny Commercials[/url]
smitchell15 (not verified)
Hi all,

I managed to get belicious and buzzmonkeys files working, after looking at the files and realizing there was nothing wrong with the file, i just reset the fields. I've had this problem happen before when importing/replacing pages in the document and was stumped by the problem too.

I don't think there is anything wrong with the file, as when i copied and pasted both peoples fields to a new document they worked straight away with no problem.

I got round their problems easily by creating a new document of the form and deleting all fields, then importing that page back into the document and duplicating the fields on that pages so they alligned perfectly and they then worked perfectly.

Hope this helps people who have encountered the same problem :- )
belicious
Registered: Jul 6 2009
Posts: 18
Hi smitchell15, buzzmonkey and thomp, I'm back to thank you for ALL for your help on my form - I know it's been ages since I posted on this topic but I have been snowed under with other work and this just found itself on the backburner. It would seem that if I leave enabling the usage rights to the very end and don't make any changes after that it continues to work just fine (I believe that this was posted somewhere). So from now on I have an un-enabled form for edits and an enabled form that the client uses until he changes his mind about something. Working perfectly. Love your work! Thanks again.
RTSFO
Registered: Nov 9 2009
Posts: 1
I am having the same issue with one of my forms where the calculation does not work.
When I to JavaScriptDebugger, I get this error:
Acrobat Database Connectivity Built-in Functions Version 8.0
Acrobat EScript Built-in Functions Version 8.0
Acrobat Annotations / Collaboration Built-in Functions Version 8.0
Acrobat Annotations / Collaboration Built-in Wizard Functions Version 8.0
Acrobat Multimedia Version 8.0
Acrobat SOAP 8.0

TypeError: vX has no properties
Any help would be greatly appreciated as I have to deliver this form to the client today.
Thank you!
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Obviously you have a variable name vX that is not defined before it is used.

So how exactly is this a related problem? You need to post this to a thread.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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