How to Keep Line Spacing Fixed While Auto-Resizing Acrobat Form Text
Question details
The user wants a narrative text box in a PDF form to preserve its visible line spacing while automatically reducing the font size as more text is entered.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Replicating a dynamic text formatting behavior originally created in LiveCycle Designer within standard Adobe Acrobat forms.
- Observed behavior
- Acrobat does not natively support preserving fixed line spacing while auto-resizing text; it requires a JavaScript workaround that updates only after the user leaves the text field.
Ensure you have access to Adobe Acrobat Pro to edit form fields and add custom JavaScript. Basic knowledge of JavaScript document scripting is helpful for implementing this form workaround.
Apply Custom JavaScript for Dynamic Font Resizing
Use a custom calculation script to adjust the font size based on the character count, mimicking the LiveCycle Designer behavior.
Standard Acrobat forms lack the native dynamic reflow architecture found in LiveCycle Designer (XFA). To approximate this auto-resizing behavior while maintaining line spacing, you must use a script that calculates the text length and reduces the font size incrementally. Note that this visual change typically takes effect only after the user clicks out of the text field.
Open your PDF document in Adobe Acrobat Pro and select the 'Prepare Form' tool from the right-hand pane.
Right-click the target narrative text box and select 'Properties' from the context menu.
In the Properties dialog, go to the 'Calculate' tab and select the option for 'Custom calculation script'.
Click the 'Edit' button and enter a JavaScript snippet that measures the character count (e.g., `event.value.length`) and dynamically sets `event.target.textSize` to a smaller number as the text grows longer. Click 'OK' to save.

Manage and Fill PDF Forms Smoothly with WPS PDF
While complex JavaScript form behaviors require advanced scripting tools, WPS Office provides a seamless, lightweight PDF editor for creating, filling, and editing standard PDF forms with highly compatible text formatting.
- 1. Open WPS Office: Launch the WPS Office desktop application and click on 'PDF Edit' to open your PDF document.
- 2. Access Form Tools: Navigate to the 'Form' or 'Fill & Sign' tab to view, modify, or interact with standard text fields and checkboxes.
- 3. Edit Text Properties: Select a text box to easily adjust font sizes, text alignment, and basic spacing using the intuitive formatting toolbar.
- 4. Save and Export: Fill out your document and save it as a highly compatible PDF file to seamlessly share with colleagues or clients.

Frequently Asked Questions
Why doesn't Acrobat auto-size text exactly like LiveCycle Designer?
LiveCycle Designer uses an XML-based architecture (XFA) designed for dynamic, reflowable forms. Standard Acrobat forms (AcroForms) use a static layout, meaning text boxes have fixed dimensions and cannot easily push surrounding content or dynamically alter line height in real-time.
Can I set a text field to 'Auto' font size in Acrobat?
Yes, you can set the font size to 'Auto' in the field's Appearance properties. However, this will shrink both the font size and the line spacing proportionally to fit all text into the box, which defeats the goal of keeping the line spacing fixed.
Does the JavaScript font resizing work on mobile PDF readers?
Usually no. Custom JavaScript calculation scripts for Acrobat forms are often unsupported or behave inconsistently on mobile PDF viewers, web browsers, and non-Adobe third-party applications.
How do I make the text resize while the user is still typing?
In standard Acrobat forms, JavaScript events like custom keystroke scripts can trigger during typing, but modifying the field's font size property mid-keystroke often causes cursor jumping or performance issues. It is highly recommended to apply size changes on the 'blur' (exit) event.




