How to Show a PDF Form Label but Prevent It from Printing
Question details
The user wants to keep a dynamically calculated PDF form label visible on the screen but hide it from the printed output depending on whether another related field is empty.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Creating dynamic PDF forms with conditional print visibility using JavaScript.
- Observed behavior
- The user needs the correct JavaScript syntax to control the display property of a specific form field during the printing process.
Ensure your PDF editing software supports JavaScript execution and allows you to modify the calculation scripts of form fields.
Use Acrobat JavaScript to Modify the Display Property
Set the display property on the calculation event target to dynamically control its print visibility based on other field values.
When configuring PDF form calculations, applying the display property directly to `event.target` rather than the standard `event` object ensures accurate behavior across different viewer applications.
Open your PDF form in edit mode, right-click the calculated form label you want to modify, and select 'Properties'.
In the Properties dialog box, select the 'Calculate' tab to input your custom script.
Choose 'Custom calculation script' and click 'Edit'. Enter your conditional logic targeting the other field.
In your script, if the related field is empty, apply the command: `event.target.display = display.noPrint;`. This keeps the label on screen but prevents it from printing.
Add the alternate condition: if the related field contains a value, apply the command: `event.target.display = display.visible;` so it prints normally.

Easily Manage PDF Form Properties with WPS Office
Instead of writing complex JavaScript to manage print visibility, you can easily control form display settings using the visual form editor built into WPS PDF.
- 1. Open PDF in WPS Office: Launch WPS Office, open your PDF document, and navigate to the 'Form' tab on the top ribbon.
- 2. Enable Form Editing: Click the 'Form Editing' button to activate the interactive field editor.
- 3. Open Field Properties: Double-click the specific text field or label you wish to hide from printing to open the Properties window.
- 4. Adjust Visibility Settings: Under the 'General' tab, locate the 'Form Field' dropdown menu and change the setting to 'Visible but doesn't print'.
- 5. Save Your Form: Close the Properties window, exit Form Editing mode, and save your document. The label will now show on screen but remain hidden when printed.

Frequently Asked Questions
Can I hide a PDF form field completely?
Yes. In your PDF editor's form field properties under the General tab, you can set the visibility status to 'Hidden'. This prevents the field from showing on both the screen and the printed document.
Why isn't my Acrobat JavaScript working in other PDF readers?
Not all third-party PDF readers fully support Acrobat JavaScript execution. For the broadest compatibility, it is often better to use standard built-in form properties like 'Visible but doesn't print' rather than relying entirely on custom scripts.
How do I make a field invisible on screen but visible when printed?
You can achieve this by accessing the form field properties in your PDF editor and changing the visibility option to 'Hidden but printable'. This is especially useful for background values or watermarks.




