Solved

Calcululation in PDF Form

Posted on 2014-10-23
7
180 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
  • 3
  • 3
7 Comments
 
LVL 16

Expert Comment

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

Expert Comment

by:krakatoa
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 4

Author Comment

by:ITworks
Comment Utility
1.png
0
 
LVL 4

Author Comment

by:ITworks
Comment Utility
2.png
0
 
LVL 16

Expert Comment

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

Accepted Solution

by:
captain earned 500 total points
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

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:/…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now