PDF Editing Issues

How to Show a PDF Form Label but Prevent It from Printing

Chanuka GeekiyanageChanuka Geekiyanage Nov 5, 2026 868 views

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.

How to Show a PDF Form Label but Prevent It from Printing
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.
Before you start

Ensure your PDF editing software supports JavaScript execution and allows you to modify the calculation scripts of form fields.

Solution 1Recommended

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.

1
Access Field Properties

Open your PDF form in edit mode, right-click the calculated form label you want to modify, and select 'Properties'.

2
Navigate to the Calculate Tab

In the Properties dialog box, select the 'Calculate' tab to input your custom script.

3
Enter the JavaScript Condition

Choose 'Custom calculation script' and click 'Edit'. Enter your conditional logic targeting the other field.

4
Set Display to noPrint

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.

5
Set Display to Visible

Add the alternate condition: if the related field contains a value, apply the command: `event.target.display = display.visible;` so it prints normally.

Use Acrobat JavaScript to Modify the Display Property
Understanding Display Properties: Using `display.noPrint` is the standard way to ensure a field is highly visible to the user filling out the form without cluttering the final printed document.

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. 1. Open PDF in WPS Office: Launch WPS Office, open your PDF document, and navigate to the 'Form' tab on the top ribbon.
  2. 2. Enable Form Editing: Click the 'Form Editing' button to activate the interactive field editor.
  3. 3. Open Field Properties: Double-click the specific text field or label you wish to hide from printing to open the Properties window.
  4. 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. 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.
Visual form field property editor requires zero codingSet fields to 'Visible but doesn't print' with a single clickFully compatible with standard Adobe PDF formsLightweight, fast, and feature-rich PDF editing suite
microsoft office alternative - wps office

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.