?
Solved

Calcululation in PDF Form

Posted on 2014-10-23
7
Medium Priority
?
202 Views
Last Modified: 2014-10-24
I have a form that I'd like to calculate the results in and I'm hoping someone could help me.

I want to calculate the percentage of 2 fields.

In the top right hand side of this form is Score: _____ Good   ____  Bad     _____  %
-form.pdf
0
Comment
Question by:ITworks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 16

Expert Comment

by:krakatoa
ID: 40399803
There is something called PDFBox, open source library.
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 40400015
Reading your question again, maybe you don't need the library interface, in which case the calc would be on the lines of

float universe=5;
float good =4;
float bad = 1;

float percentgood = 100/(universe/good);
float percentbad = 100/(universe/bad);

System.out.println(percentgood);
System.out.println(percentbad);

Open in new window


(but excuse me if you were not looking for code, (as it is quite straightforward)).
0
 
LVL 4

Author Comment

by:ITworks
ID: 40400451
Would I enter this info under Text Field Properties, Calculate, Custom calculation script:?

And....my fields are really named:
Good, Bad and Calc with Calc being the field where I want the formula calculated.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:ITworks
ID: 40400457
1.png
0
 
LVL 4

Author Comment

by:ITworks
ID: 40400461
2.png
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 40400467
I am not familiar with the PDFBox library, and so I cannot speak about how it interfaces with Java.
0
 
LVL 31

Accepted Solution

by:
captain earned 2000 total points
ID: 40401960
Hi

you don't need JS

go  to your PDF. Format Good and Bad as numbers, Calc as Percentage (Right click Properties on each field)

The in Calc field go to Calculation and use the Simplified field notation and put
Good/Bad/100

Open in new window

.

This will give you percentage of the two fields. You need the "/100" as stupidly Adobe PDF makes its own x100 calculation for the Percentage value

I have a sample attached.

hth
capt.
Percentage.pdf
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PaperPort is a popular document imaging/management product from Nuance Communications (http://www.nuance.com/). It is in widespread use by both individuals (http://www.nuance.com/for-individuals/by-product/paperport/index.htm) and businesses (http:/…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses
Course of the Month8 days, 4 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question