Solved

Calcululation in PDF Form

Posted on 2014-10-23
7
192 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

PDF files have been in the limelight due to its unmatched features.  Personal documents, emails, business reports and eBooks are all converted into PDF files owing to peerless features provided by it. Adding watermark to a PDF file is a method to se…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

820 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