Script in the document "will print" action executes only after opening print dialog box.
Why it doesn't execute before opening print dialog box?
I saw it in a different pdf file (unfortunately can't edit it because of security settings), where when I click print icon from menu item, it validates the form and then it opens print dialog box. But when I try it in my pdf form, it doesn't work.
I want to execute the script before opening the print dialog box. Is there a way to do it? Please help me.
Because opening the print dialog is not the same as printing the file. The Will Print event only executes when the file is actually printed. This is the expected and correct behavior.
If you did see what you described then it must have been through a button that was added to the document itself, or maybe even to the application, which uses a script to perform the validation and only then opens the Print dialog. It's not possible that it happened through the built-in File - Print command.
Can you share the other file?
Sorry I can't share the file and I can't edit it because it is signed document. I can share the screenshot for you.
When I click on print icon without filling the form:
Then another dialog box pops up showing print cancelled.
Was the form created with Livecycle Designer?
Just now, I have checked that pdf document properties and got to know it was developed using Lifecycle Designer.
So, we can achieve those actions using Lifecycle designer?
Looks like it is possible with LiveCycle Designer.