PDF Editing Issues

How to Display PDF Form Data on Another Page using JavaScript

Steve KSteve K Oct 28, 2026 869 views

Question details

The user wants to automatically populate a letter on the second page of a PDF with form data entered on the first page.

How to Display PDF Form Data on Another Page using JavaScript
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating an interactive PDF form where data from one page needs to be dynamically displayed on another page.
Observed behavior
Currently, the fields on page 1 do not automatically reflect their input values onto the text fields of the letter on page 2.
Before you start

Ensure you have a PDF editor that supports form field creation and custom JavaScript calculations, such as Adobe Acrobat Pro.

Solution 1Recommended

Use a Custom Calculation Script in Acrobat

Apply a JavaScript code to the destination text field so it retrieves and displays the values from the source fields.

By utilizing Acrobat JavaScript, you can dynamically pull data from multiple form fields and combine them with static text on another page.

1
Open Prepare Form Mode

Open your PDF document in Acrobat and select 'Prepare Form' from the tools menu. Ensure you have text fields created on both page one (source) and page two (destination).

2
Access Field Properties

Right-click the destination text field on page two where you want the data to appear and select 'Properties'.

3
Navigate to the Calculate Tab

In the Properties dialog box, click on the 'Calculate' tab and select the 'Custom calculation script' option.

4
Enter the JavaScript Code

Click the 'Edit' button and enter the following script: event.value = "This is some text from page 1: " + this.getField("Text1").valueAsString + "\nAnd some more text: " + this.getField("Text2").valueAsString;

5
Save and Test

Replace 'Text1' and 'Text2' with your actual field names. Click 'OK', close the properties window, and type into the page one fields to test the dynamic update on page two.

Use a Custom Calculation Script in Acrobat
Script Customization: You can concatenate multiple fields and add custom static text using the plus (+) operator. Use '\n' to create line breaks within the destination field.
Advanced PDF Form Management

Edit and Manage PDF Forms with WPS Office

WPS Office provides a comprehensive PDF editor that allows you to easily fill, edit, and manage interactive PDF forms without needing heavy or expensive software.

  1. 1. Install WPS Office: Download and install the free WPS Office suite on your device.
  2. 2. Open your PDF: Launch WPS PDF and open your interactive PDF form document.
  3. 3. Fill and Edit: Use the 'Form' tab to interact with form fields, fill in data, or edit the PDF content directly.
  4. 4. Save your Document: Save or export your completed PDF document to share with others.
Easily fill and edit interactive PDF formsFully compatible with standard Adobe PDF formatsLightweight and fast PDF reading and editing experienceConvert PDFs to Word, Excel, and PowerPoint seamlessly
microsoft office alternative - wps office

Frequently Asked Questions

Why is my custom calculation script not updating automatically?

Ensure that the field calculation order is correct. The destination field must be set to calculate after the source fields are filled. You can check and adjust the calculation order in the form editing preferences.

Can I use this JavaScript method in free PDF readers?

While most modern free PDF readers can execute the embedded JavaScript to display the calculated values, you typically need a premium PDF editor like Acrobat Pro to create and insert the custom calculation scripts into the fields initially.

How do I add a line break in my PDF JavaScript calculation?

You can add a line break by inserting '\n' within your text string in the JavaScript code. For example: event.value = "First line\nSecond line"; will display the text on two separate lines.