25 Replies Latest reply on Feb 5, 2016 7:47 AM by emmanuelem85

    Javascript on a PDF that checks the value of a specific field and then do the right calculation.

    emmanuelem85

      Hi guys!

      Sorry for my english, it's not my mothertongue.

       

      This is my first time writing here, i just discovered the great opportunities of Javascript in PDF files and i am very excited about it!

       

      I don't have experience with Javascript, this is what i would like to do:

       

      Basically, i need to calculate how many liters of gasoline are necessary to do a specific job in agricolture.

       

      I have a table that is like this:

       

      Seed: 120 Liters/Km

      To weed: 20 Liters/Km

      Fertilize: 140 Liters/Km

       

      I have 3 fields in the pdf: OPERATION/ KM / NECESSARYGASOLINE

       

      I need something like this:

      Seed = 120;

      Weed = 20;

      Fertilize = 140;

       

      IF OPERATION is "Seed" then NECESSARYGASOLINE= 120*KM;

      ELSE IF OPERATION is "Weed" then NECESSARYGASOLINE = 20*KM;

      ELSE IF OPERATION is "Fertilize" then NECESSARYGASOLINE = 140*KM;

       

       

      Is it possible to translate it in Javascript?

       

      Thank you very much for the help! It would really be wonderful!