PDF Editing Issues

How to Autofill Company Names Throughout a PDF Form

Amos GikundaAmos Gikunda Nov 10, 2026 868 views

Question details

The user wants to enter a company name once in a PDF form and have it automatically populate in multiple flowing text fields throughout the document.

How to Autofill Company Names Throughout a PDF Form
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating a dynamic PDF form where repeated information (such as a company name) only needs to be typed once by the user to appear in several different text blocks.
Observed behavior
The user needs to display the inputted company name dynamically within a larger block of text so that the surrounding words flow naturally around the length of the name.
Before you start

Ensure your PDF editor supports JavaScript and form field calculations, as these features are necessary to dynamically combine flowing text with form field inputs.

Solution 1Recommended

Use a Calculation Script in a Multiline Text Field

Set up a primary input field and use a custom JavaScript calculation in a read-only multiline field to automatically combine the flowing text with the inputted company name.

If the surrounding text must flow automatically based on the length of the company name, it must be configured as part of a single multiline field. Rich text formatting is generally not required unless the company name specifically needs a different color or font style.

1
Create the Input Field

Add a standard text field to your PDF form and name it exactly 'CompanyName'. This is the field where the user will type the company name.

2
Set Up the Flowing Text Field

Create a second text field where the paragraph of text will appear. In the field properties, set it to 'Read Only' and check the 'Multi-line' option.

3
Add the Custom Calculation Script

Navigate to the 'Calculate' tab in the second field's properties. Select 'Custom calculation script' and enter the following JavaScript code: var companyName = this.getField("CompanyName").valueAsString; event.value = "This is some text.\nThis is a new line of text.\nThe company's name is " + companyName + ".\nLast line of text.";

4
Test the Form

Save your PDF and type a name into the 'CompanyName' field. Click outside the field to trigger the calculation and watch the second field automatically update.

Exact Matching: If you just need the company name to appear by itself in multiple places (without surrounding text), simply copy the 'CompanyName' text field and paste it elsewhere. Fields with the exact same name will automatically mirror each other.

Create Interactive PDF Forms Easily with WPS Office

WPS PDF provides powerful and intuitive tools to create, edit, and manage interactive PDF forms. You can easily add text fields, checkboxes, and set up your documents for seamless data entry.

  1. 1. Open PDF in WPS Office: Launch WPS Office and open your existing PDF document or create a new blank PDF.
  2. 2. Navigate to the Form Tab: Click on the 'Form' tab on the top ribbon to access all interactive form creation tools.
  3. 3. Insert Text Fields: Select 'Text Field' and click on your document to insert fillable boxes for the company name and other required details.
  4. 4. Adjust Properties: Right-click the inserted field and select 'Properties' to rename the field, duplicate it across pages, or set it as read-only.
Easily add, edit, and format interactive PDF form fields.High compatibility with Adobe Acrobat PDF forms and properties.Lightweight and user-friendly interface for seamless PDF management.Free basic PDF viewing, editing, and annotation features available.
QA img-9

Frequently Asked Questions

Why isn't the company name updating in the second field automatically?

Ensure that your PDF viewer supports JavaScript and that JavaScript is enabled in your software preferences. Also, double-check that the field name referenced in your calculation script perfectly matches the actual Name property of the input text field (e.g., 'CompanyName').

Can I mirror form fields without using any JavaScript?

Yes. If you simply need the exact same text to appear in multiple places (without surrounding flowing text), you can copy and paste the text field. Giving multiple text fields the exact same Name property will automatically mirror the input across all of them.

How do I make the flowing text adjust to a very long company name?

By keeping the surrounding text and the dynamically inserted company name within a single text field (combined via the calculation script), the text will naturally flow and wrap to the next line based on the field's dimensions. Ensure the target field has the 'Multi-line' option checked.