Hide PDF Form Buttons in Acrobat Full-Screen Mode and Restore Their States
Question details
Hide PDF buttons and radio buttons in full-screen mode, then restore their previous visibility when full-screen mode ends.

- Product
- Adobe Acrobat PDF forms
- Device & OS
- not provided
- Scenario
- A PDF form needs a clean full-screen view without permanently changing controls that may already have different visibility settings.
- Observed behavior
- Buttons and radio buttons should be hidden during full-screen mode and return to their individual saved visibility states afterward.
Open the form in a desktop version of Adobe Acrobat that supports document-level JavaScript, and check that JavaScript is enabled. Test the form in the PDF viewer your audience will use, because browser viewers and other PDF apps may not support Acrobat JavaScript or full-screen detection.
Save and restore form-control visibility with Acrobat JavaScript
Use a document-level script to detect full-screen mode and preserve each targeted field's existing display value.
The script saves the display value of each button and radio-button field before hiding it, then restores the saved values after full-screen mode ends. It does not change the selected radio value.
The script works at the field level. If separate widgets of the same field have different visibility settings, test them carefully; field-level restoration may not preserve those widget-specific differences.
In Acrobat, open the PDF and choose All tools > Use JavaScript > Document JavaScripts. Add a named document-level script; menu wording may vary by Acrobat version.
Paste this script into the editor and save it: var fsSavedDisplays = null; var fsWasFullScreen = false; function updateFullScreenFields() { var isFullScreen = app.fs.isFullScreen; if (isFullScreen && !fsWasFullScreen) { fsSavedDisplays = []; for (var i = 0; i < this.numFields; i++) { var name = this.getNthFieldName(i); var field = this.getField(name); if (field && (field.type === "button" || field.type === "radiobutton")) { fsSavedDisplays.push({ name: name, value: field.display }); field.display = display.hidden; } } } else if (!isFullScreen && fsWasFullScreen && fsSavedDisplays) { for (var j = 0; j < fsSavedDisplays.length; j++) { var saved = fsSavedDisplays[j]; var target = this.getField(saved.name); if (target) target.display = saved.value; } fsSavedDisplays = null; } fsWasFullScreen = isFullScreen; } var fsVisibilityTimer = app.setInterval("updateFullScreenFields()", 300);
Choose File > Save, close the PDF, and reopen it so the document-level script starts. Allow JavaScript if Acrobat prompts you and you trust the document.
Enter full-screen mode using View > Full Screen Mode, then exit with Esc. Confirm that buttons and radio buttons disappear and that both previously visible and previously hidden fields return to their original states.

View PDF Forms and Office Files with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office files. Its Microsoft Office format compatibility makes migration straightforward, but it does not replace the Acrobat JavaScript solution for automatic full-screen visibility changes.

Frequently Asked Questions
Why save each field's display value before hiding it?
A field may already be hidden or use another display setting. Saving field.display before setting display.hidden lets the script restore that specific setting instead of making every field visible.
Will this script hide text fields too?
No. The field.type check targets only button and radiobutton fields. Adjust the condition if other interactive field types also need to be hidden.
Does hiding a radio button clear its selection?
No. The script changes the field's display property, not its value. Test the form in Acrobat to confirm the selected option remains intact after exiting full-screen mode.
Why does the form still show controls in my browser?
Many browser PDF viewers do not support Acrobat document-level JavaScript or its full-screen APIs. Open the saved PDF in a compatible desktop Acrobat viewer and check that JavaScript is enabled.




