PDF Editing Issues

Set a Minimum Value for a PDF Form Calculation in Adobe Acrobat

Phi Hung VoPhi Hung Vo Nov 25, 2026 868 views

Question details

Calculate the O2Min PDF form field as Weight multiplied by 50, with a minimum result of 0.5.

Set a Minimum Value for a PDF Form Calculation in Adobe Acrobat
Product
PDF form with Acrobat-compatible JavaScript
Device & OS
not provided
Scenario
A PDF form needs to calculate O2Min from the value entered in the Weight field.
Observed behavior
O2Min should display Weight multiplied by 50, or 0.5 when the calculated result is lower.
Before you start

Open the PDF in an editor that supports custom form calculation scripts, such as Adobe Acrobat Pro. Check that the form fields are named exactly Weight and O2Min, and that Weight accepts numeric values.

Solution 1Recommended

Add a Custom Calculation Script to O2Min in Adobe Acrobat

Use this script to calculate Weight × 50 while enforcing a minimum result of 0.5.

1
Open the form editor

Open the PDF in Adobe Acrobat Pro and select All tools > Prepare a form.

2
Open O2Min properties

Double-click the O2Min field to open its Properties dialog, then select the Calculate tab.

3
Enter the calculation script

Select Custom calculation script, click Edit, and enter: var result = this.getField("Weight").value * 50; if (result < 0.5) result = 0.5; event.value = result;

4
Save and test

Confirm the script, close the Properties dialog, and save the PDF. Enter values in Weight to verify that O2Min shows 0.5 for results below 0.5 and Weight × 50 otherwise.

Add a Custom Calculation Script to O2Min in Adobe Acrobat
Use numeric input: The script assumes Weight contains a numeric value. An empty value is treated as zero, so O2Min displays 0.5; nonnumeric input may not produce a valid result.
Free Microsoft Office alternative

Work With PDFs and Office Files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. Its format compatibility helps you move existing files into your workflow; use Acrobat for the custom PDF JavaScript calculation described above.

Open and work with PDF documents alongside other office files.Compatible with Microsoft Office formats including DOCX, XLSX, and PPTX.Use a familiar interface that makes migration easier.Access a lightweight office suite for free.
QA img-9

Frequently Asked Questions

What happens when Weight is less than 0.01?

Weight multiplied by 50 is below 0.5, so the script sets O2Min to 0.5. At Weight = 0.01, the calculated result is exactly 0.5.

Where do I enter the PDF calculation script?

In Adobe Acrobat Pro, open All tools > Prepare a form, double-click O2Min, and choose Calculate > Custom calculation script > Edit.

Why does an empty Weight field show 0.5 in O2Min?

In this calculation, an empty field is treated as zero. Because zero is below the minimum, the script assigns 0.5 to O2Min.

Will the calculation work in every PDF viewer?

Not necessarily. The viewer must support Acrobat-compatible form JavaScript and allow it to run. Test the saved PDF in the viewer recipients will use.