Solved

Calcululation in PDF Form

Posted on 2014-10-23
7
185 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 30

Accepted Solution

by:
captain earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how do i compare an object based on two fields 6 48
Java SE 8u111  Lot of stuff broke 11 52
Arrays.asList  VS  ArrayList 4 43
object oriented programming comparison 5 52
Power PDF (http://www.nuance.com/for-business/document-imaging-and-scanning/power-pdf-converter/index.htm) is the newest product from the Document Imaging division of Nuance Communications (http://www.nuance.com/). It is available in two editions — …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

929 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

8 Experts available now in Live!

Get 1:1 Help Now