Expand my Community achievements bar.

Disable Acrobat menu item

Avatar

Former Community Member
I have a LiveCycle Designer 7 PDF form (not dynamic) on which I have included a Print Button that has the standard script behind it:



xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);



I have added some script that fires a messagebox to the user if there are empty mandatory fields on the form. In this case, the print dialog box is not shown. In other words:



if (empty mandatory fields) {

xfa.host.messagebox "There are empty mandatory fields"

} else {

xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);

}



Of course, the user has the option of ignoring this message and using the print button/menu item in Reader to print the form. Is there any way to disable a menu item in the host (Reader)? I know you can call an Acrobat menu item from a button using

app.execMenuItem("Print");



Is there a was to disable a menu item (app.disableMenuItem("Print");)?
1 Reply

Avatar

Former Community Member
Take a look in the Acrobat JavaScripting reference for the hideMenuItem() method. I've never tried it before, but it may be want you're looking for.



H.