PDF Editing Issues

Extract the First Four Digits of a Form Calculation in Adobe Acrobat

Kushani NimanthikaKushani Nimanthika Nov 19, 2026 869 views

Question details

Display the first four characters of a form field value multiplied by 150 in another Acrobat form field.

Extract the First Four Digits of a Form Calculation in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form needs a destination field that calculates a value from a source field and displays only the beginning of the result.
Observed behavior
The destination field should show up to the first four characters of the calculated result.
Before you start

Open the PDF in Adobe Acrobat and confirm that it has a source field and a separate text field for the result. Check the source field's exact name in its properties; the example below uses Text1.0.1.

Solution 1Recommended

Add a Custom Calculation Script to the Destination Field

Use an Acrobat form calculation to multiply the source value by 150 and display the first four characters.

1
Open the form editor

In Acrobat, open the PDF and choose All tools > Prepare a form.

2
Check the source field

Double-click the source field to open its properties. Confirm its name on the General tab and select Number on the Format tab.

3
Enter the calculation

Double-click the destination text field, open the Calculate tab, select Custom calculation script, and click Edit. Enter: event.value = (this.getField("Text1.0.1").value * 150).toString().substr(0, 4); Replace Text1.0.1 with the exact source field name if needed.

4
Set the destination format

In the destination field's Format tab, select None, then close the properties dialog.

5
Test the form

Exit form editing or select Preview, enter a number in the source field, and move to another field to check the result.

Add a Custom Calculation Script to the Destination Field
Characters versus digits: The script takes the first four characters, so a minus sign or decimal point counts toward the limit. It does not add leading zeros if the result has fewer than four characters.
Free Microsoft Office alternative

Work With PDF Forms and Office Files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. It can help you move between common file formats, but it does not replace the Acrobat-specific calculation script described above.

Open and review PDF forms alongside other documentsCompatible with Microsoft Word DOCX and Excel XLSX filesFamiliar tools make it easy to move from Microsoft OfficeFree, lightweight suite for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Where do I put the Acrobat calculation script?

Open All tools > Prepare a form, double-click the destination field, and select Calculate > Custom calculation script > Edit.

How do I use a different source field name?

Check the source field's name on its General properties tab, then replace Text1.0.1 inside this.getField("Text1.0.1") with that exact name.

Does the script always return four digits?

No. It returns up to four characters from the calculated value. A minus sign or decimal point counts as a character, and shorter results are not padded with zeros.

What format should I use for the result field?

In the destination text field's properties, open the Format tab and select None so Acrobat does not apply number formatting to the extracted text.