PDF Editing Issues

How to Extract Formatted Display Values from Acrobat PDF Number Fields

Bushra ParveenBushra Parveen Nov 2, 2026 869 views

Question details

The user needs to retrieve the exact formatted string displayed in a PDF number field (such as "25,10 USD***") instead of the underlying raw numeric value.

How to Extract Formatted Display Values from PDF Number Fields
Product
PDF Forms
Device & OS
not provided
Scenario
Extracting form data from interactive PDFs where specific number, locale, and currency formatting rules are applied.
Observed behavior
Standard extraction methods return the raw numeric value (e.g., 25.1) rather than the visually formatted string displayed to the user.
Before you start

Ensure you have access to the PDF's script editor and basic knowledge of Acrobat JavaScript, as you will need to write a custom script to recreate the display formatting.

Solution 1Recommended

Use Acrobat JavaScript to Reformat the Extracted Value

Because the raw value is separated from the display format in PDF forms, you must use JavaScript formatting functions to reconstruct the displayed string dynamically.

Interactive PDF forms store the raw numeric value to allow for background calculations, applying display formatting visually on top of it. Because you cannot directly extract the formatted display string from a standard Acrobat form field, you must script a function that retrieves the raw value and explicitly applies the same formatting rules.

1
Access Document Scripts

Open your PDF form in editing mode and access the JavaScript editor or the specific form field's action scripts.

2
Retrieve Raw Value

Write a script to retrieve the raw field value using a command like `var rawValue = this.getField("YourFieldName").value;`.

3
Apply Formatting Functions

Use the built-in `util.printf()` or `util.printx()` JavaScript functions to format the retrieved number.

4
Define Locale and Rules

Explicitly define the locale, decimal separator, currency code, and any custom suffixes (e.g., "***") within your formatting function to perfectly match the original field's visual display properties.

Use Acrobat JavaScript to Reformat the Extracted Value
XFA Forms Limitation: If you are working with XFA (LiveCycle Designer) forms instead of standard Acrobat forms, the scripting object model is different and util.printf() may not apply in the same way.
Professional PDF Editor

Edit and Manage PDF Forms with WPS Office

WPS Office provides a robust set of PDF tools, allowing you to easily view, fill, and manage interactive PDF forms, including checking field properties and extracting form data efficiently.

  1. 1. Open PDF in WPS Office: Launch WPS Office and open your interactive PDF document containing the forms.
  2. 2. Navigate to Form Tools: Switch to the 'Form' tab on the top ribbon to access the form viewing and editing utilities.
  3. 3. Inspect Form Fields: Click on the specific number fields to interact with them or view their properties depending on your document's permissions.
  4. 4. Export Form Data: Use the 'Export' or 'PDF to Excel' features to pull your structured form data into a spreadsheet for easier formatting and extraction.
Easily edit interactive PDF form properties and data.Fully compatible with Microsoft Word, Excel, and standard PDF form formats.Lightweight interface for quick data extraction.Built-in tools to convert PDFs to spreadsheets for easier data management.
microsoft office alternative - wps office

Frequently Asked Questions

Why does extracting a PDF form field give me a different number than what is displayed?

PDF forms store numbers as raw data (e.g., 25.1) to allow for background calculations. The displayed format (e.g., "25,10 USD***") is a visual overlay. Standard extraction pulls the raw calculation data, not the visual text.

Can I copy the formatted text directly without scripting?

If you are simply reading the PDF, you can manually highlight and copy the text. However, automated extraction tools or form data exports will generally pull the raw underlying value, necessitating a script to recreate the format if automation is required.

Does util.printf() work in all PDF viewers?

The util.printf() function is part of the standard Acrobat JavaScript API. It works reliably in professional PDF editors like Adobe Acrobat and WPS Office, though some basic web browsers or mobile viewers may have limited JavaScript support.