Guide de l'utilisateur
Nitro PDF Pro
JavaScript

Add or edit custom calculation JavaScript

Any form you create that requires calculations is likely to require custom calculation scripts. The options you have available with preset calculation formulas are limited to simple multiplication and addition. Other kind of calculation you need requires writing a script.

To write a calculation script

  1. Ouvrir le PDF dans Nitro Pro
  2. On the Forms ribbon, in the Form Fields group, click Text Field
  3. Select the text field to edit
  4. Right-click and select Properties
  5. Click the Calculate tab
  6. Click the Custom calculation script option, and then click the Edit button
  7. Type the code for your script. In the example below, a simple routine is created to calculate sales tax at a 7.25 % rate. The code used is:

    var f = this.getField(subtotal);
    event.value = Math.round(f.value * 7.25)/100;

  8. Cliquez sur d'accord
Tags
Nitro PDF Pro
Bibliothèque de contenus

Numérisation de bout en bout de vos workflows documentaires

Une nouvelle étude de GigaOm compare et évalue les fonctionnalités et les capacités des solutions de signature électronique et d'édition PDF leaders du secteur.
Portions of this page translated by Google.