Javascript in pdf for calculated result
The company I work at has a lot of print orders containings books and magazines.
For now we use a website, but we would like to use a pdf calculating the spine thickness.
Now is coding not one of my best skills, but coding in pdf files is completely new for me.
The result should be that a client can choose a paper weight from a dropdown menu, a amount of pages and a paper volume. Say if the volume would be "matt" and the pagecount is 128 and the weight would be 130, the sum would be:
Spine = (9*130*128)/20000
Every volume has a own parameter. so does softcover and hardcover. Every var is linked to a form field in the said PDF. Now the problem starts when I want to get the value of the dropdown menu using getfield. How does the script know the value of the selected value in the dropdown menu.
If it is not clear enough I will give more information.
Thanks in advance.
var Volume = this.getField("Volume");
var Weight = this.getField("Weight");
var Count = this.getField("Count");
var Cover = this.getField("Cover");
var Spine;
/////Paper Volume
if (Volume.value == "Matt")
{
return "9";
}
if (Volume.value == "Gloss")
{
return "8";
}
if (Volume.value == "Silk")
{
return "9";
}
/////Cover kiezen
if (Cover.value == "Hardcover")
{
return "6";
}
if (Cover.value == "Softcover")
{
return "1";
}
Spine = Volume*Weight*Count/20000;
