How to Calculate Quantity, Price, and Discount in Adobe Acrobat PDF Forms
Question details
The user needs a mathematical formula to calculate the final total amount in a PDF form using quantity, unit price, and a percentage discount.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating or editing an interactive PDF invoice or order form that requires automatic calculation of discounted totals based on user inputs.
- Observed behavior
- The user needs the correct formula syntax to successfully subtract the percentage discount from the subtotal (Quantity multiplied by Price) and display the final total amount in the form field.
Ensure that your PDF form fields for Quantity, Price, and Discount are already created and properly named so they can be accurately referenced in your calculation script.
Apply Simplified Field Notation for 0-100 Percentage Discounts
Use this standard mathematical approach if your users enter discounts as whole numbers (e.g., entering '15' for a 15% discount).
Adobe Acrobat allows you to use basic math operations in text fields. This method is straightforward and doesn't require complex programming knowledge. It works best when your form's discount field is expected to receive whole number percentages.
Open your document in Adobe Acrobat, navigate to the Tools menu, and select 'Prepare Form' to make your fields editable.
Right-click the text field where you want the final total to appear and select 'Properties'. Navigate to the 'Calculate' tab.
Choose the 'Simplified field notation' radio button, then click the 'Edit' button next to it.
Enter the following formula exactly, replacing the names with your actual field names if they differ: Quantity * Price * (100 - Discount) / 100
Click 'OK', close the Properties window, and switch back to 'Preview' mode to test your calculation by entering sample numbers.

Use Custom JavaScript for Decimal Format Discounts
If the discount is formatted as a decimal (e.g., 0.15 for 15%), use a Custom Calculation Script.
Easily Calculate Quantity, Price, and Discounts in WPS Spreadsheet
Instead of writing complex custom JavaScript or field notations in a PDF editor, you can effortlessly create and calculate your invoices using WPS Spreadsheet. It provides a simple, familiar environment for calculating totals with discounts and allows you to quickly export the final result directly as a professional PDF.
- 1. Create a New Spreadsheet: Open WPS Office and create a new Blank Spreadsheet to serve as your invoice or order form.
- 2. Set Up Your Columns: Create header columns for Quantity, Unit Price, Discount (%), and Final Total.
- 3. Input the Formula: Click the cell in your Total column and enter the formula using cell references (e.g., =A2*B2*(1-C2)), then press Enter.
- 4. Export to PDF: Once your invoice is complete and calculated, go to 'Menu' and click 'Export to PDF' to save your work as a professional document.

Frequently Asked Questions
Why is my PDF form calculation returning a zero or error?
This usually happens if the field names in your formula do not perfectly match the names of the fields in your PDF form. Field names are strictly case-sensitive. Additionally, ensure that the format of these text fields is set to 'Number' under the Format tab in their Properties.
Can I apply a flat amount discount instead of a percentage?
Yes. If your users are entering a specific dollar amount to be subtracted rather than a percentage, you should change your simplified field notation formula to: (Quantity * Price) - DiscountAmount.
How do I calculate a grand total of multiple discounted items?
Create a new text field for the Grand Total. Open its Properties, go to the Calculate tab, choose the 'Value is the sum (+)' option, and then select all the individual item 'Total' fields from the list provided.




